Closed SamirJoza closed 5 years ago
I can confirm this issue. Except that the plugin does work with the latest ACF PRO production version. It does NOT work however with the free ACF production versions (5.8.0 nor 5.8.1)
Same for me, I'm running ACF 5.8.1 and having the same problem.
It seems that the plugin is trying to call "acf_register_block()" which is the old function in ACF to register blocks, the new one is called "acf_register_block_type()".. Please, can you fix this?
I've removed "className" on line 104 and now it works for me.
Yes you should change line 104 to this:
$class_name = (empty($block['className'])) ? false : $block['className'] . ',';
$block['classes'] = implode(' ', [$block['slug'], $class_name . 'align'.$block['align']]);
But this is a different issue then the OP. After fixing the plugin still only works in ACF PRO, not the free ACF. May I assume you' running ACF PRO as well @nahojj ?
@jnaklaas I do use ACF PRO as well! I don't think the block registration for ACF is free :)
Please read: https://www.advancedcustomfields.com/pro/
I see :) In that case, as far as I'm concerned this issue's solved.
Closing this since it seems to be solved. I can reopen if anyone using PRO finds this issue as well.
I am using the ACF Pro version and I can't register a new block categories.
In filters.php
add_filter( 'block_categories', function ($categories, $post ) {
if ( $post->post_type !== 'post' ) { return $categories; } return array_merge( $categories, array( array( 'slug' => 'acf-blocks', 'title' => __( 'ACF Blocks', 'acf-blocks' ), 'icon' => 'wordpress', ), ) ); }, 10, 2);
Then on my block template: {{-- Title: Section Cards Description: Section of a page with cards. Category: acf-blocks Icon: admin-comments Keywords: section, cards Mode: edit Align: full PostTypes: page post SupportsAlign: false SupportsMode: true SupportsMultiple: true SupportsInnerBlocks: true EnqueueAssets: path/to/asset --}}
Hi, maybe it's just me, since I am fairly new to Sage, but my custom blocks used to work with ACF 5.8 latest RC, but once I updated ACF to the latest production version, everything literally disappeared. And is no longer working. this is what I have in my /app/filters.php
add_filter( 'block_categories', function( $categories, $post ) { return array_merge( $categories, array( array( 'slug' => 'xsp', 'title' => 'Special Blocks', ), ) ); }, 10, 2 );
and then in /resources/views/blocks/newsletter-article.blade.php `{{-- Title: Newsletter Article Description: Newsletter Article Category: xsp Icon: media-document Keywords: Mode: edit Align: left SupportsMode: false SupportsMultiple: false PostTypes: page --}}<article data-{{$block['id']}} class="{{ $block['classes'] }} summary">
{{NewsletterArticle::Article()['category_name']}}
{!!NewsletterArticle::Article()['title']!!}
{!!NewsletterArticle::Article()['img']!!}
{!!NewsletterArticle::Article()['content']!!}
Click to read more
` As I said, it used to work flawlessly, but with the upgrade to the latest ACF version, all no working. Even if I change Category to 'formatting' the block is not being made available.
Any help is greatly appreciated.