/** * */ public function enqueue_scripts() { parent::enqueue_scripts(); if ($this->get_setting('printCss') == 'true') { $theme = $this->get_theme(); wp_enqueue_style('hw-metaslider-' . $this->get_setting('type') . '-slider-' . $theme, HW_METASLIDER_ASSETS_URL . "sliders/nivoslider/themes/{$theme}/{$theme}.css", false, HW_METASLIDER_VERSION); } }
/** * Include slider assets */ public function enqueue_scripts() { parent::enqueue_scripts(); if ($this->get_setting('printJs') == 'true' && ($this->get_setting('effect') == 'slide' || $this->get_setting('carouselMode') == 'true')) { wp_enqueue_script('hw-metaslider-easing', HW_METASLIDER_ASSETS_URL . 'easing/jQuery.easing.min.js', array('jquery'), HW_METASLIDER_VERSION); } }
/** * Create a new slider */ private function add_slider() { // check nonce check_admin_referer("metaslider_add_slider"); $defaults = array(); // if possible, take a copy of the last edited slider settings in place of default settings if ($last_modified = $this->find_slider('modified', 'DESC')) { $defaults = get_post_meta($last_modified, 'hw-ml-slider_settings', true); } // insert the post $id = wp_insert_post(array('post_title' => __("New Slider", "metaslider"), 'post_status' => 'publish', 'post_type' => 'hw-ml-slider')); // use the default settings if we can't find anything more suitable. if (empty($defaults)) { $slider = new HW_MetaSlider($id, array()); $defaults = $slider->get_default_parameters(); } // insert the post meta add_post_meta($id, 'hw-ml-slider_settings', $defaults, true); // create the taxonomy term, the term is the ID of the slider itself wp_insert_term($id, 'hw-ml-slider'); return $id; }