function scripts() { pl_script('pl-site', pl_framework_url('js') . '/site.js', array('jquery')); pl_script('pl-common', pl_framework_url('js') . '/common.js'); pl_style('pl-components', pl_framework_url('css') . '/components.css'); // wp_enqueue_media(); }
/** * Include extra scripts and styles here * Use the pl_script and pl_style functions (which enqueues the files) */ function section_styles() { /** Include the sample script */ pl_script($this->id, $this->base_url . '/scripts.js'); pl_script($this->id, $this->base_url . '<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>'); pl_style('style-css', $this->base_url . '/style.css'); }
/** * Template for the shortcode */ function template($atts, $content) { extract(shortcode_atts(array('section' => 'content', 'id' => isset($atts['section']) ? $atts['section'] . pl_edit_id() : false, 'settings' => array()), $atts)); global $plfactory; if (!isset($plfactory->section_ids[$section])) { pl_missing_section($section); return; } else { $object = $plfactory->section_ids[$section]; } $s = $plfactory->factory[$object]; $s->meta = array('clone' => $id, 'object' => $object, 'content' => array()); /** Allow for a function that can be used to set defaults */ $settings = get_section_data($s); $plfactory->add_section_to_factory($id, $object, $settings); $s->meta['set'] = $settings; ob_start(); $s->section_styles(); /** Auto load build.css document which is generated from build.less */ if (is_file($s->base_dir . '/build.css')) { pl_style($section, $s->base_url . '/build.css'); } if (is_file($s->base_dir . '/style.css')) { pl_style($section, $s->base_url . '/style.css'); } echo '<div class="temp-wrap pl-sn-shortcode" data-bind="stopBinding: true" >'; $s->render($s->meta); echo "\n</div>\n"; wp_reset_postdata(); // Reset $post data wp_reset_query(); // Reset wp_query return apply_filters('pl_section', ob_get_clean(), $atts, $content); }
function workarea_enqueue() { wp_deregister_script('jquery-ui'); global $wp_styles; $wp_styles->queue = array('admin-bar'); global $wp_scripts; $wp_scripts->queue = array(); pl_script('pl-common', pl_framework_url('js') . '/common.js', array('jquery'), false, false); pl_style('pl-components', pl_framework_url('css') . '/components.css'); pl_style('pl-editing', pl_framework_url('css') . '/workarea.css'); pl_script('pl-editing', pl_framework_url('js') . '/editing.js', array('jquery'), false, false); pl_script('pl-utils', pl_framework_url('js') . '/utils.js', array('jquery'), false, false); /** WordPress Color Picker */ pl_enqueue_color_picker(); wp_enqueue_script('jquery'); global $pl_page; $this->page = $pl_page; global $maps_data_handler; $this->map = $maps_data_handler; global $plfactory; $this->factory = $plfactory; global $plselector; $this->selector = $plselector; wp_localize_script('pl-editing', 'PLWorkarea', $this->workarea_config()); pl_hook('pl_workarea_enqueue'); }
/** * Include extra scripts and styles here * Use the pl_script and pl_style functions (which enqueues the files) */ function section_styles() { /** Include the sample script */ pl_script($this->id, $this->base_url . '/scripts.js'); pl_style('style-css', $this->base_url . '/style.css'); }
function pl_load_codemirror($path = '') { // Codemirror Styles pl_style('codemirror', $path . '/codemirror/codemirror.css'); // CodeMirror Syntax Highlighting pl_script('pl-codemirror', $path . '/codemirror/pl.codemirror.js', array('jquery'), '', false); // Codebox defaults $base_editor_config = array('lineNumbers' => true, 'lineWrapping' => false, 'tabSize' => 2); wp_localize_script('pl-codemirror', 'cm_base_config', apply_filters('pagelines_cm_config', $base_editor_config)); }