AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
823 stars 168 forks source link

ACF 6.2 beta1 Disabling the options page UI using the provided filter has no effect #854

Closed CreativeDive closed 11 months ago

CreativeDive commented 11 months ago

Hey,

I've noticed that using ...

add_filter( 'acf/settings/enable_options_pages_ui', '__return_false' );

... has no effect. The new options page UI is still there.

mattgrshaw commented 11 months ago

Hey @CreativeDive, thanks for testing!

Was that hooked in a theme or in a plugin? We actually just recently noticed that if it's in a theme, its ran too late. But if you add into a custom plugin it does seem to work.

I've just raised an issue on our side to make sure it works in themes as well for the proper release.

CreativeDive commented 11 months ago

The filter is placed inside a plugin code at the same position I've used other ACF filter like:

acf/field_group/auto_add_first_field acf/blocks/no_fields_assigned_message acf/settings/l10n ....

mattgrshaw commented 11 months ago

Hm that's interesting... Is that code all wrapped up in acf/init or similar?

CreativeDive commented 11 months ago

No all the ACF filters I've used in the past are not wrapped inside a function assigned to an action.

mattgrshaw commented 11 months ago

Ah ok. It seems that it comes down to the plugin load order in this case. Since ACF starts with the letter "A", not much is gonna load before it!

We'll get this fixed up, thanks again for the report.

mattgrshaw commented 11 months ago

Hey @CreativeDive, this should be fixed up in 6.2.0-RC1. If you get a chance to give that a try, please let us know if that fixes the issue for you as well.

CreativeDive commented 11 months ago

Jap, it seems RC1 fixed this issue. Thank you!