Skip to content

Multiple CMB2s and helper-functions.php fatal errors #520

@DevinWalker

Description

@DevinWalker

If I have two plugins installed that both use CMB2 for their options/fields I see: Fatal error: Cannot redeclare cmb2_dir() (previously declared in /srv/www/wordpress-default/wp-content/plugins/.../includes/libraries/cmb2/includes/helper-functions.php:18) in /srv/www/wordpress-default/wp-content/plugins/.../includes/libraries/metabox/includes/helper-functions.php on line 18

I see that it's simply required here: https://github.com/WebDevStudios/CMB2/blob/master/init.php#L144

Shouldn't these functions be wrapped in a function_exists() conditional? How can multiple plugins/themes use CMB2 successfully with the helper functions included like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions