public function init() { $this->addHooks(); /** * If current mode of VC is frontend editor load it. */ if(vc_is_frontend_editor()) { vc_frontend_editor()->hookLoadEdit(); } elseif(vc_mode() === 'page_editable') { /** * if page loaded inside frontend editor iframe it has page_editable mode. * It required to some some js/css elements and add few helpers for editor to be used. */ $this->buildEditablePage(); } else { // Is it is simple page just enable buttons and controls $this->buildPage(); } }
public function load() { if (defined('WPCF7_VERSION') && (vc_is_frontend_ajax() || vc_is_frontend_editor())) { require_once WPCF7_PLUGIN_DIR . '/includes/controller.php'; function_exists('wpcf7_add_shortcodes') && wpcf7_add_shortcodes(); } }
/** * @since 4.3 */ public function buildShortcode() { if (class_exists('RevSlider')) { vc_lean_map('rev_slider_vc', array($this, 'addShortcodeSettings')); if (vc_is_frontend_ajax() || vc_is_frontend_editor()) { add_filter('vc_revslider_shortcode', array(&$this, 'setId')); } } }
public function load() { add_filter('vc_object_id', array(&$this, 'filterMediaId')); add_filter('vc_basic_grid_filter_query_suppress_filters', '__return_false'); add_filter('vc_frontend_editor_iframe_url', array(&$this, 'appendLangToUrl')); add_filter('admin_url', array(&$this, 'appendLangToUrl')); if (!vc_is_frontend_editor()) { add_filter('vc_get_inline_url', array(&$this, 'appendLangToUrl')); } }
public function load() { add_action('vc_backend_editor_render', array($this, 'enqueueJsBackend')); add_action('vc_frontend_editor_render', array($this, 'enqueueJsFrontend')); add_filter('vc_frontend_editor_iframe_url', array($this, 'appendLangToUrl')); add_filter('vc_nav_front_controls', array($this, 'vcNavControlsFrontend')); if (!vc_is_frontend_editor()) { add_filter('vc_get_inline_url', array($this, 'vcRenderEditButtonLink')); } }
public function load() { if (vc_is_frontend_editor() && class_exists('JWP6_Plugin')) { // add_shortcode('jwplayer', array('JWP6_Plugin', 'shortcode')); // add_filter('query_vars', array('JWP6_Plugin', 'register_query_vars')); // add_action('parse_request', array('JWP6_Plugin', 'parse_request'), 9 ); // add_action('wp_enqueue_scripts', array('JWP6_Plugin', 'insert_javascript')); // add_action('wp_head', array('JWP6_Plugin', 'insert_license_key')); // add_action('wp_head', array('JWP6_Plugin', 'insert_jwp6_load_event')); } }
public function load() { add_filter('vc_object_id', array($this, 'filterMediaId')); add_filter('vc_basic_grid_filter_query_suppress_filters', '__return_false'); add_filter('vc_frontend_editor_iframe_url', array($this, 'appendLangToUrl')); add_filter('vc_grid_request_url', array($this, 'appendLangToUrl')); add_filter('vc_admin_url', array($this, 'appendLangToUrl')); if (!vc_is_frontend_editor()) { add_filter('vc_get_inline_url', array($this, 'appendLangToUrl')); } global $sitepress; $action = vc_post_param('action'); if (vc_is_page_editable() && 'vc_frontend_load_template' === $action) { // Fix Issue with loading template #135512264670405 remove_action('wp_loaded', array($sitepress, 'maybe_set_this_lang')); } }
/** * @since 4.3 */ public function load() { $this->setLanguages(); global $q_config; add_filter('vc_frontend_get_page_shortcodes_post_content', array(&$this, 'filterPostContent')); add_action('vc_backend_editor_render', array(&$this, 'enqueueJsBackend')); add_action('vc_frontend_editor_render', array(&$this, 'enqueueJsFrontend')); add_action('vc_frontend_editor_render_template', array(&$this, 'vcFrontEndEditorRender')); add_filter('vc_nav_controls', array(&$this, 'vcNavControls')); add_filter('vc_nav_front_controls', array(&$this, 'vcNavControlsFrontend')); add_filter('vc_frontend_editor_iframe_url', array(&$this, 'vcRenderEditButtonLink')); if (!vc_is_frontend_editor()) { add_filter('vc_get_inline_url', array(&$this, 'vcRenderEditButtonLink')); } $q_lang = vc_get_param('qlang'); if (is_string($q_lang)) { $q_config['language'] = $q_lang; } add_action('init', array(&$this, 'qtransPostInit'), 1000); }
/** * Add shortcode and filters for layerslider id * @since 4.3 */ public function buildShortcode() { if (!class_exists('LS_Sliders')) { include_once LS_ROOT_PATH . '/classes/class.ls.sliders.php'; } $ls = LS_Sliders::find(array('limit' => 999, 'order' => 'ASC')); $layer_sliders = array(); if (!empty($ls)) { foreach ($ls as $slider) { $layer_sliders[$slider['name']] = $slider['id']; } } else { $layer_sliders[__('No sliders found', 'js_composer')] = 0; } vc_map(array('base' => 'layerslider_vc', 'name' => __('Layer Slider', 'js_composer'), 'icon' => 'icon-wpb-layerslider', 'category' => __('Content', 'js_composer'), 'description' => __('Place LayerSlider', 'js_composer'), 'params' => array(array('type' => 'textfield', 'heading' => __('Widget title', 'js_composer'), 'param_name' => 'title', 'description' => __('Enter text which will be used as widget title. Leave blank if no title is needed.', 'js_composer')), array('type' => 'dropdown', 'heading' => __('LayerSlider ID', 'js_composer'), 'param_name' => 'id', 'admin_label' => true, 'value' => $layer_sliders, 'description' => __('Select your LayerSlider.', 'js_composer')), array('type' => 'textfield', 'heading' => __('Extra class name', 'js_composer'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'js_composer'))))); // Load layer slider shortcode && change id if (vc_is_frontend_ajax() || vc_is_frontend_editor()) { add_filter('vc_layerslider_shortcode', array(&$this, 'setId')); } }
public function buildShortcode() { if (is_plugin_active('revslider/revslider.php')) { global $wpdb; $rs = $wpdb->get_results("\n SELECT id, title, alias\n FROM " . $wpdb->prefix . "revslider_sliders\n ORDER BY id ASC LIMIT 999\n "); $revsliders = array(); if ($rs) { foreach ($rs as $slider) { $revsliders[$slider->title] = $slider->alias; } } else { $revsliders[__('No sliders found', 'js_composer')] = 0; } vc_map(array('base' => 'rev_slider_vc', 'name' => __('Revolution Slider', 'js_composer'), 'icon' => 'icon-wpb-revslider', 'category' => __('Content', 'js_composer'), 'description' => __('Place Revolution slider', 'js_composer'), "params" => array(array('type' => 'textfield', 'heading' => __('Widget title', 'js_composer'), 'param_name' => 'title', 'description' => __('Enter text which will be used as widget title. Leave blank if no title is needed.', 'js_composer')), array('type' => 'dropdown', 'heading' => __('Revolution Slider', 'js_composer'), 'param_name' => 'alias', 'admin_label' => true, 'value' => $revsliders, 'description' => __('Select your Revolution Slider.', 'js_composer')), array('type' => 'textfield', 'heading' => __('Extra class name', 'js_composer'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'js_composer'))))); } // if revslider plugin active if (vc_is_frontend_ajax() || vc_is_frontend_editor()) { add_filter('vc_revslider_shortcode', array(&$this, 'setId')); } }
public function buildShortcode() { if (is_plugin_active('LayerSlider/layerslider.php')) { global $wpdb; $ls = $wpdb->get_results("\n SELECT id, name, date_c\n FROM " . $wpdb->prefix . "layerslider\n WHERE flag_hidden = '0' AND flag_deleted = '0'\n ORDER BY date_c ASC LIMIT 999\n "); $layer_sliders = array(); if ($ls) { foreach ($ls as $slider) { $layer_sliders[$slider->name] = $slider->id; } } else { $layer_sliders[__('No sliders found', LANGUAGE_ZONE)] = 0; } vc_map(array('base' => 'layerslider_vc', 'name' => __('Layer Slider', LANGUAGE_ZONE), 'icon' => 'icon-wpb-layerslider', 'category' => __('Content', LANGUAGE_ZONE), 'description' => __('Place LayerSlider', LANGUAGE_ZONE), 'params' => array(array('type' => 'textfield', 'heading' => __('Widget title', LANGUAGE_ZONE), 'param_name' => 'title', 'description' => __('Enter text which will be used as widget title. Leave blank if no title is needed.', LANGUAGE_ZONE)), array('type' => 'dropdown', 'heading' => __('LayerSlider ID', LANGUAGE_ZONE), 'param_name' => 'id', 'admin_label' => true, 'value' => $layer_sliders, 'description' => __('Select your LayerSlider.', LANGUAGE_ZONE)), array('type' => 'textfield', 'heading' => __('Extra class name', LANGUAGE_ZONE), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', LANGUAGE_ZONE))))); // Load layer slider shortcode && change id if (vc_is_frontend_ajax() || vc_is_frontend_editor()) { include LS_ROOT_PATH . '/wp/shortcodes.php'; add_filter('vc_layerslider_shortcode', array(&$this, 'setId')); } } // if layer slider plugin active }
/** * @since 4.3 */ public function buildShortcode() { if (class_exists('RevSlider')) { $slider = new RevSlider(); $arrSliders = $slider->getArrSliders(); $revsliders = array(); if ($arrSliders) { foreach ($arrSliders as $slider) { /** @var $slider RevSlider */ $revsliders[$slider->getTitle()] = $slider->getAlias(); } } else { $revsliders[__('No sliders found', 'js_composer')] = 0; } // add shortcode to visual composer $this->mapShortcode($revsliders); // Add fixes for frontend editor to regenerate id if (vc_is_frontend_ajax() || vc_is_frontend_editor()) { add_filter('vc_revslider_shortcode', array(&$this, 'setId')); } } }
public function load() { if (class_exists('JWP6_Plugin')) { if (vc_is_frontend_editor()) { JWP6_Shortcode::add_filters(); add_filter('query_vars', array('JWP6_Plugin', 'register_query_vars')); add_action('parse_request', array('JWP6_Plugin', 'parse_request'), 9); add_action('wp_enqueue_scripts', array('JWP6_Plugin', 'insert_javascript')); add_action('wp_head', array('JWP6_Plugin', 'insert_license_key')); add_action('wp_head', array('JWP6_Plugin', 'insert_jwp6_load_event')); add_action('vc_load_iframe_jscss', array(&$this, 'vc_load_iframe_jscss')); if (JWP6_USE_CUSTOM_SHORTCODE_FILTER) { remove_filter('the_content', array('JWP6_Shortcode', 'the_content_filter'), 11); remove_filter('the_excerpt', array('JWP6_Shortcode', 'the_excerpt_filter'), 11); remove_filter('widget_text', array('JWP6_Shortcode', 'widget_text_filter'), 11); add_shortcode('jwplayer', array('JWP6_Plugin', 'shortcode')); } JWP6_Plugin::insert_javascript(); } add_action('wp_enqueue_scripts', array(&$this, 'vc_load_iframe_jscss')); add_filter('vc_front_render_shortcodes', array(&$this, 'renderShortcodes')); add_filter('vc_shortcode_content_filter_after', array(&$this, 'renderShortcodesPreview')); } }
public function addElementsList() { return '<ul class="wpb-content-layouts-container" style="position: relative;"> ' . $this->getContentCategoriesLayouts() . (!vc_is_frontend_editor() ? '<li><input id="vc_elements_name_filter" type="text" name="vc_content_filter" placeholder="' . __('Search by element name', "js_composer") . '"/></li>' : '') . $this->getContentLayouts() . ' </ul>'; }
/** * @depreacted since 4.8 ( use vc_is_frontend_editor ) * @since 4.2 * @return bool */ function vc_is_editor() { return vc_is_frontend_editor(); }
/** * Add javascript to extend functionality of templates editor panel or new panel(since 4.4) */ public function addEditorTemplates() { $dependency = vc_is_frontend_editor() ? array('vc_inline_build_js', 'vc_inline_js') : array('wpb_js_composer_js_view'); wp_enqueue_script('vc_plugin_inline_templates', $this->assetURL('js/templates_panels.js'), $dependency, WPB_VC_VERSION, true); add_action('admin_footer', array(&$this, 'addTemplateraJs')); }
/** * Enqueue required javascript libraries and css files. * * This method also setups reminder about license activation. * * @since 4.2 * @access public */ public function printScriptsMessages() { if (!vc_is_frontend_editor() && $this->isValidPostType(get_post_type())) { $this->enqueueEditorScripts(); } }
/** * Add javascript to extend functionality of templates editor panel or new panel(since 4.4) */ public function addEditorTemplates() { $dependency = vc_is_frontend_editor() ? array('vc_inline_build_js', 'vc_inline_js') : array('wpb_js_composer_js_view'); if ($this->isPanelVcVersion()) { wp_enqueue_script('vc_plugin_inline_templates', $this->assetURL('js/templates_panels.js'), $dependency, WPB_VC_VERSION, true); } else { //@deprecated since 4.4, we use new panel windows. wp_enqueue_script('vc_plugin_inline_templates', $this->assetURL('js/inline.js'), $dependency, WPB_VC_VERSION, true); //@deprecated since 4.4, we use new pane windows and do not need to override it just extend add_action('admin_footer', array(&$this, 'renderEditorTemplate')); } add_action('admin_footer', array(&$this, 'addTemplateraJs')); }
public function addEditorTemplates() { $dependency = vc_is_frontend_editor() ? array('vc_inline_js') : array('wpb_js_composer_js_view'); wp_enqueue_script('vc_plugin_inline_templates', $this->assetURL('js/inline.js'), $dependency, time(), true); add_action('admin_footer', array(&$this, 'renderEditorTemplate')); }
/** * */ public function init() { $this->addHooks(); /** * If current mode of VC is frontend editor load it. */ if (vc_is_frontend_editor()) { vc_frontend_editor()->hookLoadEdit(); } elseif (vc_mode() === 'page_editable') { /** * if page loaded inside frontend editor iframe it has page_editable mode. * It required to some some js/css elements and add few helpers for editor to be used. */ $this->buildEditablePage(); } else { // Is it is simple page just enable buttons and controls $this->buildPage(); } /** * Load required vendors classes; * @deprecated since 4.4 due to autoload logic */ visual_composer()->vendorsManager()->load(); }
/** * Callback function for WP init action hook. Sets Vc mode and loads required objects. * * @since 4.2 * @access public * @return void */ public function init() { do_action('vc_before_init'); $this->setMode(); /** * Set version of VC if required. */ $this->setVersion(); // Load required !vc_is_updater_disabled() && vc_updater()->init(); /** * Init default hooks and options to load. */ $this->vc()->init(); /** * if is admin and not front end editor. */ is_admin() && !vc_is_frontend_editor() && $this->asAdmin(); /** * if frontend editor is enabled init editor. */ vc_enabled_frontend() && vc_frontend_editor()->init(); // Load Automapper vc_automapper()->addAjaxActions(); do_action('vc_before_mapping'); // VC ACTION // Include default shortcodes. $this->mapper()->init(); //execute all required do_action('vc_after_mapping'); // VC ACTION // Load && Map shortcodes from Automapper. vc_automapper()->map(); do_action('vc_after_init'); }
/** * Enqueue required javascript libraries and css files. * * This method also setups reminder about license activation. * * @since 4.2 * @access public */ public function printScriptsMessages() { if (!vc_is_frontend_editor() && $this->isValidPostType()) { if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-updater-tab')->get()) { vc_license()->setupReminder(); } $this->enqueueEditorScripts(); } }
/** * Callback function for WP init action hook. Sets Vc mode and loads required objects. * * @since 4.2 * @access public * * @return void */ public function init() { do_action('vc_before_init'); $this->setMode(); do_action('vc_after_set_mode'); /** * Set version of VC if required. */ $this->setVersion(); // Load required !vc_is_updater_disabled() && vc_updater()->init(); /** * Init default hooks and options to load. */ $this->vc()->init(); /** * if is admin and not front end editor. */ is_admin() && !vc_is_frontend_editor() && $this->asAdmin(); /** * if frontend editor is enabled init editor. */ vc_enabled_frontend() && vc_frontend_editor()->init(); do_action('vc_before_mapping'); // VC ACTION // Include default shortcodes. $this->mapper()->init(); //execute all required do_action('vc_after_mapping'); // VC ACTION // Load && Map shortcodes from Automapper. vc_automapper()->map(); if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-updater-tab')->get()) { vc_license()->setupReminder(); } do_action('vc_after_init'); }
/** * Add WP ui pointers to backend editor. */ function vc_frontend_editor_pointer() { vc_is_frontend_editor() && add_filter('vc-ui-pointers', 'vc_frontend_editor_register_pointer'); }