mcguffin / acf-openstreetmap-field

WordPress ACF Field for OpenStreetMap
https://wordpress.org/plugins/acf-openstreetmap-field/
GNU General Public License v3.0
107 stars 22 forks source link

Not working when ACF is included via theme #5

Closed oasit closed 5 years ago

oasit commented 5 years ago

When ACF is loaded via the theme (between setup_theme and after_setup_theme) the OSM field is not available. No matter if loaded as plugin by WP or manually in the theme.

mcguffin commented 5 years ago

Hi, does it work when you change line 22 in include/ACFFieldOpenstreetmap/Core/Core.php to

add_action( 'init' , array( $this , 'init_compat' ), 0 );

instead of add_action('plugins_loaded', ...)?

oasit commented 5 years ago

No, it doesn't. 'init' seems to be too late. 'plugins_loaded' seems to be toot early, ACF isn't loaded at plugins_loaded when ACF is loaded via the theme.

'acf/include_field_types' is working!

mcguffin commented 5 years ago

Okay, acf/include_field_types it is then... Would you mind to run another test with the current master? If it works, I'll release it.

oasit commented 5 years ago

Sorry, because of some other small bugs and because we are using Mapbox for the frontend, we wrote an ACF Mapbox field on our own. I can not and will not test the current master but I can confirm that 'acf/include_field_types' works with v0.1.8.