Hi,
Sorry we have just found the issue when Multiple CMB2s and helper-functions.php fatal errors.
We use this code:
if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && !defined( 'CMB2_LOADED') ) {
require_once WP_PLUGIN_DIR . '/cmb2/init.php';
} else {
require_once PLUGIN_HARU_VIDI_DIR . '/includes/libraries/cmb2/init.php';
}
if ( defined( 'CMB2_LOADED') ) {
include_once PLUGIN_HARU_VIDI_DIR . '/includes/libraries/cmb2-conditionals/cmb2-conditionals.php';
include_once PLUGIN_HARU_VIDI_DIR . '/includes/libraries/cmb2-attached-posts/cmb2-attached-posts-field.php';
include_once PLUGIN_HARU_VIDI_DIR . '/includes/libraries/cmb2-radio-image/cmb2-radio-image.php';
include_once PLUGIN_HARU_VIDI_DIR . '/includes/libraries/cmb2-switch-button/cmb2-switch-button.php';
include_once PLUGIN_HARU_VIDI_DIR . '/includes/libraries/cmb-field-select2/cmb-field-select2.php';
include_once PLUGIN_HARU_VIDI_DIR . '/includes/libraries/cmb2-text-list/cmb2-text-list.php';
}
but when active we use this error:
Warning: include_once(/Users/abc/webroot/wordpress/abc/vidimo/wp-content/plugins/cmb2/includes/CMB2_Radio_Image.php): failed to open stream: No such file or directory in /Users/abc/webroot/wordpress/abc/vidimo/wp-content/plugins/cmb2/includes/helper-functions.php on line 44
Warning: include_once(): Failed opening '/Users/abc/webroot/wordpress/abc/vidimo/wp-content/plugins/cmb2/includes/CMB2_Radio_Image.php' for inclusion (include_path='.:') in /Users/abc/webroot/wordpress/abc/vidimo/wp-content/plugins/cmb2/includes/helper-functions.php on line 44
Warning: include_once(/Users/abc/webroot/wordpress/abc/vidimo/wp-content/plugins/cmb2/includes/CMB2_Switch_Button.php): failed to open stream: No such file or directory in /Users/abc/webroot/wordpress/harutheme/vidimo/wp-content/plugins/cmb2/includes/helper-functions.php on line 44
This happen only when both CMB2 and our plugin install and active.
Can you have a solution in this case?
Thanks so much!
****
Best regards,
HaruTheme