示例#1
0
 /**
  * Non-modular Admin Assets
  *
  * @since 2.0.0
  */
 function themeblvd_non_modular_assets()
 {
     global $pagenow;
     // Assets for editing posts
     if ($pagenow == 'post-new.php' || $pagenow == 'post.php') {
         wp_enqueue_style('tb_meta_box-styles', TB_FRAMEWORK_URI . '/admin/assets/css/meta-box.min.css', false, false, 'screen');
         wp_enqueue_script('tb_meta_box-scripts', TB_FRAMEWORK_URI . '/admin/assets/js/meta-box.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
         wp_localize_script('tb_meta_box-scripts', 'themeblvd', themeblvd_get_admin_locals('js'));
     }
     // Styles for all of WP admin -- Currently only applies to
     // Builder and Sliders plugin menu items and making them
     // retina-compatible... Fancy, right?
     if (defined('TB_SLIDERS_PLUGIN_VERSION') || defined('TB_BUILDER_PLUGIN_VERSION')) {
         wp_enqueue_style('tb_admin_global', TB_FRAMEWORK_URI . '/admin/assets/css/admin-global.min.css', null, TB_FRAMEWORK_VERSION);
     }
 }
 /**
  * Loads the javascript
  *
  * @since 1.0.0
  */
 public function load_scripts()
 {
     // WP-packaged scripts
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('jquery-ui-sortable');
     wp_enqueue_script('postbox');
     if (function_exists('wp_enqueue_media') && function_exists('themeblvd_media_uploader')) {
         wp_enqueue_media();
     }
     // Theme Blvd scripts
     wp_enqueue_script('themeblvd_admin', TB_FRAMEWORK_URI . '/admin/assets/js/shared.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('themeblvd_options', TB_FRAMEWORK_URI . '/admin/options/js/options.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('themeblvd_sliders', TB_SLIDERS_PLUGIN_URI . '/includes/admin/js/sliders.min.js', array('jquery'), TB_SLIDERS_PLUGIN_VERSION);
     // Localize scripts
     wp_localize_script('themeblvd_sliders', 'themeblvd', themeblvd_get_admin_locals('js'));
 }
示例#3
0
 /**
  * Scripts for WordPress cusomizer.
  *
  * @since 2.1.0
  */
 function themeblvd_customizer_scripts()
 {
     wp_register_script('themeblvd_customizer', get_template_directory_uri() . '/framework/admin/assets/js/customizer.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('themeblvd_customizer');
     wp_localize_script('themeblvd_customizer', 'themeblvd', themeblvd_get_admin_locals('customizer_js'));
 }
 /**
  * Loads the javascript
  *
  * @since 1.0.0
  */
 public function load_scripts()
 {
     global $pagenow;
     // WP-packaged scripts
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('jquery-ui-sortable');
     wp_enqueue_script('postbox');
     if (function_exists('wp_enqueue_media')) {
         wp_enqueue_media();
     }
     // Theme Blvd scripts
     wp_enqueue_script('themeblvd_admin', TB_FRAMEWORK_URI . '/admin/assets/js/shared.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('themeblvd_options', TB_FRAMEWORK_URI . '/admin/options/js/options.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('color-picker', TB_FRAMEWORK_URI . '/admin/options/js/colorpicker.min.js', array('jquery'));
     // @TODO change back to min
     wp_enqueue_script('themeblvd_builder', TB_BUILDER_PLUGIN_URI . '/includes/admin/assets/js/builder.js', array('jquery'), TB_BUILDER_PLUGIN_VERSION);
     // Add JS locals when needed.
     if ($pagenow == 'post-new.php' || $pagenow == 'post.php') {
         // Edit Page Screen: This is a fallback for prior to
         // framework v2.3 where framework metabox scripts were
         // not localized by default.
         if (version_compare(TB_FRAMEWORK_VERSION, '2.3.0', '<')) {
             wp_localize_script('tb_meta_box-scripts', 'themeblvd', themeblvd_get_admin_locals('js'));
             // @see add_js_locals()
         }
     } else {
         // Localize script for actual Builder page.
         wp_localize_script('themeblvd_builder', 'themeblvd', themeblvd_get_admin_locals('js'));
         // @see add_js_locals()
     }
 }
 /**
  * Load scripts.
  *
  * @since 2.2.0
  */
 public function load_scripts()
 {
     wp_enqueue_script('jquery-ui-core');
     if (function_exists('wp_enqueue_media')) {
         wp_enqueue_media();
     }
     wp_enqueue_script('themeblvd_admin', TB_FRAMEWORK_URI . '/admin/assets/js/shared.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_localize_script('themeblvd_admin', 'themeblvd', themeblvd_get_admin_locals('js'));
     wp_enqueue_script('themeblvd_options', TB_FRAMEWORK_URI . '/admin/options/js/options.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('color-picker', TB_FRAMEWORK_URI . '/admin/options/js/colorpicker.min.js', array('jquery'));
 }
 /**
  * Loads the javascript
  *
  * @since 1.0.0
  */
 public function load_scripts()
 {
     global $pagenow;
     // Theme Blvd scripts
     wp_enqueue_script('themeblvd_admin', TB_FRAMEWORK_URI . '/admin/assets/js/shared.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('themeblvd_options', TB_FRAMEWORK_URI . '/admin/options/js/options.min.js', array('jquery'), TB_FRAMEWORK_VERSION);
     wp_enqueue_script('themeblvd_sidebars', TB_SIDEBARS_PLUGIN_URI . '/includes/admin/assets/js/sidebars.min.js', array('jquery'), TB_SIDEBARS_PLUGIN_VERSION);
     // Add JS locals. Not needed for Edit Page screen, already exists.
     if ($pagenow != 'post-new.php' && $pagenow != 'post.php') {
         wp_localize_script('themeblvd_sidebars', 'themeblvd', themeblvd_get_admin_locals('js'));
         // @see add_js_locals()
     }
 }