Пример #1
0
 /**
  * This callbacks ensures that the Premise specific CSS and JS are loaded on the appropriate pages.
  * @return void
  */
 function enqueueAdministrativeResourcesForAdminPages()
 {
     global $pagenow, $post;
     if (in_array($pagenow, array('post.php', 'post-new.php')) && $post->post_type != $this->_type_LandingPage) {
         return;
     }
     global $editor_styles;
     $editor_styles = array();
     wp_enqueue_style('premise_custom_buttons', premise_get_custom_buttons_stylesheet_url());
     wp_enqueue_style('premise-admin', PREMISE_RESOURCES_URL . 'premise-admin.css', array('thickbox'), PREMISE_VERSION);
     wp_enqueue_script('premise-admin', PREMISE_RESOURCES_URL . 'premise-admin.js', array('jquery', 'editor', 'thickbox'), PREMISE_VERSION, true);
     wp_localize_script('premise-admin', 'Premise', array('tabs_warning' => 5, 'graphics_title' => __('Premise Graphics', 'premise'), 'optin_title' => __('Premise Opt In', 'premise'), 'button_title' => __('Premise Buttons', 'premise')));
 }
Пример #2
0
 function enqueue_theme_scripts_css()
 {
     global $premise_base;
     $post_id = $this->get_post_id();
     $meta = $premise_base->get_premise_meta($post_id);
     $key = $meta['style'];
     if (!file_exists(premise_get_settings_stylesheet_path($key)) || trim(premise_get_settings_stylesheet_contents($key)) == '') {
         premise_create_stylesheets();
     }
     if (!file_exists(premise_get_custom_buttons_stylesheet_path())) {
         $premise_base->save_configured_buttons_stylesheet(array(), $premise_base->get_configured_buttons());
     }
     if ($this->_use_premise_theme && file_exists(premise_get_settings_stylesheet_path($key))) {
         if (!premise_is_minified($key)) {
             wp_enqueue_style('premise', PREMISE_THEMES_URL . 'premise/style.css', array(), filemtime(PREMISE_DIR . 'themes/premise/style.css'));
             wp_enqueue_style('premise_settings_stylesheet', premise_get_settings_stylesheet_url($key), false, filemtime(premise_get_settings_stylesheet_path($key)));
             if (is_file(premise_get_custom_stylesheet_path($key))) {
                 wp_enqueue_style('premise_custom_stylesheet', premise_get_custom_stylesheet_url($key), false, filemtime(premise_get_custom_stylesheet_path($key)));
             }
         } else {
             // Otherwise, if minified, then add reference to minified stylesheet, and remove style.css reference
             wp_enqueue_style('premise_minified_stylesheet', premise_get_minified_stylesheet_url($key), false, filemtime(premise_get_minified_stylesheet_path($key)));
         }
     }
     wp_enqueue_style('premise_custom_buttons', premise_get_custom_buttons_stylesheet_url());
     wp_enqueue_script('premise_easing', PREMISE_THEMES_URL . 'premise/js/jquery-easing.js', array('jquery'), PREMISE_VERSION);
     wp_enqueue_script('premise_coda_slider', PREMISE_THEMES_URL . 'premise/js/jquery-coda.js', array('jquery', 'premise_easing'), PREMISE_VERSION);
     wp_enqueue_script('premise_pretty_photo', PREMISE_THEMES_URL . 'premise/js/jquery-overlay.js', array('jquery'), PREMISE_VERSION);
 }