Comments (7)
Nice work, 6.1.2 update seems to fix the issue in our case 🚀
from acf.
Hey folks, thanks for the reports on this one.
As mentioned earlier in the thread we released ACF 6.1.2 today, which should resolve most if not all of these issues.
We do still recommend registering things like field groups and options pages inside the acf/init
hook if possible, so we're going to update our documentation and the ACF PHP export code to reflect this.
from acf.
I can confirm that something has changed. Our hooks added to "acf/init" are not working anymore, at all.
This is a bug? Or an intended, but undocumented change?!
from acf.
thanks for the report. this should to the trick right?
add_action("acf/init",function(){
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array(
'key' => 'group_639ca3bf19def',
'title' => 'Block: Content-Block',
'fields' => array(
array(
'key' => 'field_639ca3bfbbaba',
'label' => 'Content-Block',
'name' => 'content-block',
'aria-label' => '',
'type' => 'select',
'instructions' => 'Inhalte <a href="edit.php?post_type=ct_content_block" target="_blank">hier anlegen / ändern</a>',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
1701 => 'Wetter',
1334 => 'Öffnungszeiten',
),
'default_value' => false,
'return_format' => 'value',
'multiple' => 0,
'allow_null' => 0,
'ui' => 0,
'ajax' => 0,
'placeholder' => '',
),
),
));
endif;
});
from acf.
I can confirm that something has changed. Our hooks added to "acf/init" are not working anymore, at all.
This is a bug? Or an intended, but undocumented change?!
We have the same issue here, our function that registers block_type are never called by the hook on acf/init.
It was working fine on 6.0.7 but it's broken since 6.1
from acf.
We also have the same issue. It seems that every add_action( 'acf/init', function(){} )
-call in our theme does actually nothing, since ACF has already triggered acf/init
-hook before theme executes add_action()
. I think the reason is this change in acf_add_local_field_group()
-function in 6.1.1 update.
Depending on how and where you run acf_add_local_field_group()
-functions, this can create race-condition situation where acf_add_local_field_group()
(and thus acf_init()
and thus do_action('acf/init')
) is executed before add_action( 'acf/init', function(){} )
is executed in theme.
For example, we had following code in mu-plugin:
add_action( 'plugins_loaded', function () {
if ( function_exists( 'acf_add_local_field_group' ) ) :
acf_add_local_field_group( $args );
endif;
} );
When we changed it to use acf/init
instead of plugins_loaded
-hook, everything seems to be working fine.
However, the same issue occurs also, if I follow the official documentation and add acf_add_local_field_group()
straight to the functions.php
of theme. So I'm not sure whether or not this is issue with ACF or just how we use ACF 🤔 Nevertheless at least the docs should be changed so that acf_add_local_field_group()
is always inside of acf/init
-hook in every code examples.
from acf.
Thank you very much.
I.e. you recognise it as a bug and I don't have to change my code and should wait for the update?
from acf.
Related Issues (20)
- Please remove all crap related to license activation checking HOT 8
- post-object field select2 'search' in wp-admin not returning results when on subsite of multisite HOT 1
- Changing field to not be required using `acf/prepare_field` fails validation HOT 2
- The save_post_terms array values assigned but not saved for bidirectional values
- Presence of fields on a post type breaks iframe editor, even when fields are positioned to the side HOT 1
- Multiple URLs and wrong canonical url with ACF custom post type and custom permalink HOT 1
- ACF Tab align left group display issue HOT 1
- The ACF API integration issue with attachments
- Only Preview mode is available in WP 6.5beta1 HOT 6
- potential infinite loop in acf_get_field_ancestors()
- Block fields now show in the right hand side panel HOT 1
- True/False field fold together and can't be changed/updated HOT 3
- When returning false in acf/load_field or acf/prepare_field multiple warnings occur HOT 1
- ACF post preview and revisions completely broken HOT 8
- WYSIWYG 'visual' tab in sidebar breaks when switching sidebar tabs HOT 1
- WYSIWYG Editor Field: Image element with width and height attributes triggers unsafe HTML error message HOT 4
- filter wysiwyg_tinymce_settings breaking HOT 1
- Front-end form submits itself when closing the wordpress link-edit dialogue
- Nested cloned repeater only works for 1 level
- Gallery - edit image breaks field in block sidebar HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf.