Skip to content

Commit

Permalink
Added conditional check for constant before including CMB2 #389
Browse files Browse the repository at this point in the history
  • Loading branch information
devin committed Nov 9, 2015
1 parent d8ed02c commit f201d85
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 149 deletions.
9 changes: 5 additions & 4 deletions includes/admin/register-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public function give_settings( $active_tab ) {
array(
'id' => 'admin_notice_emails',
'name' => __( 'Donation Notification Emails', 'give' ),
'desc' => sprintf(__( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give' ), '<span class="give-underline">', '</span>'),
'desc' => sprintf( __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give' ), '<span class="give-underline">', '</span>' ),
'type' => 'textarea',
'default' => get_bloginfo( 'admin_email' )
),
Expand Down Expand Up @@ -1112,10 +1112,11 @@ function give_hook_callback( $args ) {
* @description: Checks to see if CMB2 plugin is installed first the uses included CMB2; we can still use it even it it's not active. This prevents fatal error conflicts with other themes and users of the CMB2 WP.org plugin
*
*/
if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) ) {

if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
require_once WP_PLUGIN_DIR . '/cmb2/init.php';
} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) ) {
} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php';
} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) ) {
} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
}
Loading

0 comments on commit f201d85

Please sign in to comment.