Esempio n. 1
0
 /**
  * Get script & style suffix
  *
  * When SCRIPT_DEBUG is defined true, this will return '.min'.
  *
  * @since  0.2.0
  * @since  0.9.0 Deprecated.
  * @return string
  */
 public static function get_script_suffix()
 {
     _deprecated_function(__METHOD__, '0.9.0', 'kucrut_get_script_suffix');
     return kucrut_get_script_suffix();
 }
Esempio n. 2
0
 /**
  * Enqueue stylesheets
  *
  * @since   0.1.0
  * @wp_hook action wp_enqueue_scripts
  * @link    http://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts
  */
 public static function _enqueue_styles()
 {
     foreach (self::$icon_types as $type) {
         if (wp_style_is($type->stylesheet_id, 'registered')) {
             wp_enqueue_style($type->stylesheet_id);
         }
     }
     /**
      * Allow plugins/themes to override the extra stylesheet location
      *
      * @since 0.9.0
      * @param string $extra_stylesheet_uri Extra stylesheet URI.
      */
     $extra_stylesheet_uri = apply_filters('menu_icons_extra_stylesheet_uri', sprintf('%scss/extra%s.css', Menu_Icons::get('url'), kucrut_get_script_suffix()));
     wp_enqueue_style('menu-icons-extra', $extra_stylesheet_uri, false, Menu_Icons::VERSION);
 }
Esempio n. 3
0
 /**
  * Enqueue scripts & styles for Appearance > Menus page
  *
  * @since   0.3.0
  * @wp_hook action admin_enqueue_scripts
  */
 public static function _enqueue_assets()
 {
     $url = Menu_Icons::get('url');
     $suffix = kucrut_get_script_suffix();
     wp_enqueue_style('menu-icons', "{$url}css/admin{$suffix}.css", false, Menu_Icons::VERSION);
     wp_enqueue_script('menu-icons', "{$url}js/admin{$suffix}.js", self::$script_deps, Menu_Icons::VERSION, true);
     /**
      * Allow plugins/themes to filter the settings' JS data
      *
      * @since 0.9.0
      * @param array $js_data JS Data.
      */
     $js_data = apply_filters('menu_icons_settings_js_data', array('text' => array('title' => __('Select Icon', 'menu-icons'), 'select' => __('Select', 'menu-icons'), 'remove' => __('Remove', 'menu-icons'), 'change' => __('Change', 'menu-icons'), 'all' => __('All', 'menu-icons'), 'preview' => __('Preview', 'menu-icons'), 'settingsInfo' => sprintf(esc_html__("Please note that the actual look of the icons on the front-end will also be affected by your active theme's style. You can use %s if you need to override it.", 'menu-icons'), '<a target="_blank" href="http://wordpress.org/plugins/simple-custom-css/">Simple Custom CSS</a>')), 'settingsFields' => self::get_settings_fields(), 'activeTypes' => self::get('global', 'icon_types'), 'ajaxUrls' => array('update' => add_query_arg('action', 'menu_icons_update_settings', admin_url('/admin-ajax.php'))), 'menuSettings' => self::get_menu_settings(self::get_current_menu_id())));
     wp_localize_script('menu-icons', 'menuIcons', $js_data);
 }