google-maps-builder icon indicating copy to clipboard operation
google-maps-builder copied to clipboard

CMB2 issue with hook cmb2_admin_init

Open samikeijonen opened this issue 10 years ago • 4 comments

I got this kind of error when I try to switch hook cmb2_init to cmb2_admin_init as current version is suggesting.

Fatal error: Cannot redeclare cmb2_dir() (previously declared in ...\wp-content\plugins\cmb2\includes\helper-functions.php:18) in ...\wp-content\plugins\google-maps-builder\includes\libraries\metabox\includes\helper-functions.php on line 20

samikeijonen avatar Oct 21 '15 13:10 samikeijonen

Hey there - Can you please provide more context as to what you're trying to achieve? I see you have the CMB2 Plugin installed alongside Maps Builder - do you wish to run the two simultaneously?

DevinWalker avatar Oct 21 '15 17:10 DevinWalker

Yes I have CMB2 plugin installed. I didn't realize that you have bundled it in your plugin also. Should there be some kind of check that if the plugin is around.

After that it's just basic metabox settings for custom theme.

samikeijonen avatar Oct 21 '15 17:10 samikeijonen

Yes I've seen more themes including CMB2 as a plugin and I have the code already to add to Maps Builder to check for it installed. I'll make this a priority. Thanks for reporting.

DevinWalker avatar Oct 21 '15 17:10 DevinWalker

Thanks. I personally install and activate plugin version because in that way I don't have to keep track of the changes and update my custom theme/plugin.

And I pretty often register metaboxes in custom plugin also.

samikeijonen avatar Oct 21 '15 17:10 samikeijonen