Skip to content

Commit

Permalink
update styles/scripts methods to prevent conflict with CMB
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrickaby committed Sep 23, 2014
1 parent 997ec6e commit 130a158
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/CMB2_hookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ public static function register_scripts() {
// styles required for cmb
$styles = array( 'wp-color-picker' );

wp_register_script( 'cmb-scripts', cmb2_utils()->url( "js/cmb2{$min}.js" ), $scripts, CMB2_VERSION );
wp_register_script( 'cmb2-scripts', cmb2_utils()->url( "js/cmb2{$min}.js" ), $scripts, CMB2_VERSION );

wp_enqueue_media();

wp_localize_script( 'cmb-scripts', 'cmb2_l10', apply_filters( 'cmb2_localized_data', array(
wp_localize_script( 'cmb2-scripts', 'cmb2_l10', apply_filters( 'cmb2_localized_data', array(
'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ),
'ajaxurl' => admin_url( '/admin-ajax.php' ),
'script_debug' => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG,
Expand Down Expand Up @@ -182,7 +182,7 @@ public static function register_scripts() {
),
) ) );

wp_register_style( 'cmb-styles', cmb2_utils()->url( "css/cmb2{$min}.css" ), $styles );
wp_register_style( 'cmb2-styles', cmb2_utils()->url( "css/cmb2{$min}.css" ), $styles );

self::$registration_done = true;
}
Expand Down Expand Up @@ -355,7 +355,7 @@ public function once( $action, $hook, $priority = 10, $accepted_args = 1 ) {
public static function enqueue_cmb_css() {
CMB2_hookup::register_scripts();

return wp_enqueue_style( 'cmb-styles' );
return wp_enqueue_style( 'cmb2-styles' );
}

/**
Expand All @@ -365,7 +365,7 @@ public static function enqueue_cmb_css() {
public static function enqueue_cmb_js() {
CMB2_hookup::register_scripts();

return wp_enqueue_script( 'cmb-scripts' );
return wp_enqueue_script( 'cmb2-scripts' );
}

}

0 comments on commit 130a158

Please sign in to comment.