• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP vc_frontend_editor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中vc_frontend_editor函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_frontend_editor函数的具体用法?PHP vc_frontend_editor怎么用?PHP vc_frontend_editor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了vc_frontend_editor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: init

	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();
		}
	}
开发者ID:verbazend,项目名称:AWFA,代码行数:18,代码来源:class-vc-frontend-editor.php


示例2: vca_init

function vca_init()
{
    //  Labels
    $labels = array('name' => _x('VC Elements', 'post type general name', PLUGIN_VCA_TEXT_DOMAIN), 'singular_name' => _x('VC Element', 'post type singular name', PLUGIN_VCA_TEXT_DOMAIN), 'menu_name' => _x('VC Elements', 'admin menu', PLUGIN_VCA_TEXT_DOMAIN), 'name_admin_bar' => _x('VC Element', 'add new on admin bar', PLUGIN_VCA_TEXT_DOMAIN), 'add_new' => _x('Add New', 'vc element', PLUGIN_VCA_TEXT_DOMAIN), 'add_new_item' => __('Add New VC Element', PLUGIN_VCA_TEXT_DOMAIN), 'new_item' => __('New VC Element', PLUGIN_VCA_TEXT_DOMAIN), 'edit_item' => __('Edit VC Element', PLUGIN_VCA_TEXT_DOMAIN), 'view_item' => __('View VC Element', PLUGIN_VCA_TEXT_DOMAIN), 'all_items' => __('All VC Elements', PLUGIN_VCA_TEXT_DOMAIN), 'search_items' => __('Search VC Elements', PLUGIN_VCA_TEXT_DOMAIN), 'parent_item_colon' => __('Parent VC Elements:', PLUGIN_VCA_TEXT_DOMAIN), 'not_found' => __('No vc elements found.', PLUGIN_VCA_TEXT_DOMAIN), 'not_found_in_trash' => __('No vc elements found in Trash.', PLUGIN_VCA_TEXT_DOMAIN));
    //  Arguments
    $args = array('labels' => $labels, 'public' => false, 'publicly_queryable' => false, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => false, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'editor'), 'register_meta_box_cb' => 'vca_register_meta_box_cb');
    //  Register the Post Type
    register_post_type(POST_TYPE_VC_ELEMENT, $args);
    //  Get the Post Type Options
    $ptOptions = get_option('wpb_js_content_types');
    //  Check
    if (!$ptOptions) {
        $ptOptions = array('page');
    }
    //  Assign
    $ptOptions = array_unique(array_merge($ptOptions, array(POST_TYPE_VC_ELEMENT)));
    //  Update Option
    update_option('wpb_js_content_types', $ptOptions);
    //  Get Page Now
    global $pagenow;
    //  Check for the VC Element Page
    if ($pagenow == 'edit.php' && @$_GET['post_type'] == POST_TYPE_VC_ELEMENT) {
        //  Remove the Filter
        remove_filter('post_row_actions', array(vc_frontend_editor(), 'renderRowAction'));
    }
}
开发者ID:shadesoforange,项目名称:shoreline-new,代码行数:26,代码来源:vc-widget-addon.php


示例3: getControlFrontend

 public function getControlFrontend()
 {
     if (!vc_enabled_frontend()) {
         return '';
     }
     return '<li class="vc_pull-right">' . '<a href="' . vc_frontend_editor()->getInlineUrl() . '" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn" id="wpb-edit-inline">' . __('Frontend', "js_composer") . '</a>' . '</li>';
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:7,代码来源:class-vc-navbar.php


示例4: generateSelectFrontend

 /**
  * @return string
  */
 public function generateSelectFrontend()
 {
     global $q_config;
     $output = '';
     $output .= '<select id="vc_vendor_qtranslatex_langs_front" class="vc_select vc_select-navbar">';
     $inline_url = vc_frontend_editor()->getInlineUrl();
     $activeLanguage = $q_config['language'];
     $availableLanguages = $q_config['enabled_languages'];
     foreach ($availableLanguages as $lang) {
         $output .= '<option value="' . add_query_arg(array('lang' => $lang), $inline_url) . '"' . ($activeLanguage == $lang ? ' selected' : '') . ' > ' . qtranxf_getLanguageNameNative($lang) . '</option > ';
     }
     $output .= '</select > ';
     return $output;
 }
开发者ID:ksan5835,项目名称:maadithottam,代码行数:17,代码来源:class-vc-vendor-qtranslate-x.php


示例5: renderFrontendTemplate

 /**
  * Used to render template for frontend
  * @since 4.4
  *
  * @param $template_id
  * @param $template_type
  *
  * @return string|int
  */
 public function renderFrontendTemplate($template_id, $template_type)
 {
     if (self::$template_type === $template_type) {
         WPBMap::addAllMappedShortcodes();
         // do something to return output of templatera template
         $post = get_post($template_id);
         if ($this->isSamePostType($post->post_type)) {
             vc_frontend_editor()->enqueueRequired();
             vc_frontend_editor()->setTemplateContent($post->post_content);
             vc_frontend_editor()->render('template');
             die;
         }
     }
     return $template_id;
 }
开发者ID:siiiiilvio,项目名称:kadcnc,代码行数:24,代码来源:vc_template_manager.php


示例6: init

 /**
  *
  */
 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();
 }
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:27,代码来源:class-vc-frontend-editor.php


示例7: vcFrontendEditorRender

 /**
  * @since 4.3
  */
 public function vcFrontendEditorRender()
 {
     global $q_config;
     $output = '';
     $q_lang = vc_get_param('qlang');
     if (!is_string($q_lang)) {
         $q_lang = $q_config['language'];
     }
     $output .= '<input type="hidden" id="vc_vendor_qtranslate_postcontent" value="' . esc_attr(vc_frontend_editor()->post()->post_content) . '" data-lang="' . $q_lang . '"/>';
     $output .= '<input type="hidden" id="vc_vendor_qtranslate_posttitle" value="' . esc_attr(vc_frontend_editor()->post()->post_title) . '" data-lang="' . $q_lang . '"/>';
     echo $output;
 }
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:15,代码来源:class-vc-vendor-qtranslate.php


示例8: array

<?php

if (vc_frontend_editor()->inlineEnabled()) {
    vc_include_template('pages/partials/vc-roles-parts/_part.tpl.php', array('part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who($role)->part($part), 'custom_value' => 'custom', 'options' => array(array(true, __('Enabled', 'js_composer')), array(false, __('Disabled', 'js_composer'))), 'main_label' => __('Frontend editor', 'js_composer'), 'custom_label' => __('Frontend editor', 'js_composer')));
}
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:5,代码来源:_frontend_editor.tpl.php


示例9: init

 /**
  * 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');
 }
开发者ID:nignjatov,项目名称:TaxiDev,代码行数:42,代码来源:js_composer.php


示例10: new_vc

/**
 * New Vc now called Frontend editor
 * @deprecated 4.7
 * @return Vc_Frontend_Editor
 * @since 4.3
 */
function new_vc()
{
    // _deprecated_function( 'new_vc', '4.7 (will be removed in 4.10)', 'vc_frontend_editor' );
    return vc_frontend_editor();
}
开发者ID:k2jysy,项目名称:wedev,代码行数:11,代码来源:helpers_api.php


示例11: renderFrontendDefaultTemplate

 /**
  * Load frontend default template content by index
  */
 public function renderFrontendDefaultTemplate()
 {
     $template_index = vc_post_param('template_name');
     $data = $this->getDefaultTemplate($template_index);
     !$data && die('0');
     vc_frontend_editor()->setTemplateContent(trim($data['content']));
     vc_frontend_editor()->enqueueRequired();
     vc_include_template('editors/frontend_template.tpl.php', array('editor' => vc_frontend_editor()));
     die;
 }
开发者ID:szpaddy,项目名称:the7,代码行数:13,代码来源:class-vc-templates-editor.php


示例12: addFrontendTemplatesShortcodesCustomCss

 /**
  * Add custom css from shortcodes from template for template editor.
  *
  * Used by action 'wp_print_scripts'.
  *
  * @todo move to autoload or else some where.
  * @since 4.4.3
  *
  * @return string
  */
 public function addFrontendTemplatesShortcodesCustomCss()
 {
     $output = $shortcodes_custom_css = '';
     $shortcodes_custom_css = visual_composer()->parseShortcodesCustomCss(vc_frontend_editor()->getTemplateContent());
     if (!empty($shortcodes_custom_css)) {
         $output .= '<style type="text/css" data-type="vc_shortcodes-custom-css">';
         $output .= $shortcodes_custom_css;
         $output .= '</style>';
     }
     echo $output;
 }
开发者ID:VitaAprel,项目名称:mynotebook,代码行数:21,代码来源:class-vc-templates-panel-editor.php


示例13: renderFrontendDefaultTemplate

 /**
  * Load frontend default template content by index
  * Used in Vc_Frontend_Editor::loadShortcodes action 'vc_frontend_default_template'
  * @deprecated 4.4 use action 'vc_frontend_default_template_panel' and
  *   Vc_Templates_Panel_Editor::renderFrontendDefaultTemplate
  */
 public function renderFrontendDefaultTemplate()
 {
     // _deprecated_function( 'Vc_Templates_Editor::renderMenu', '4.4 (will be removed in 4.11)', 'Vc_Templates_Panel_Editor::renderFrontendDefaultTemplat' );
     $template_index = vc_post_param('template_name');
     $data = $this->getDefaultTemplate($template_index);
     !$data && die('0');
     vc_frontend_editor()->setTemplateContent(trim($data['content']));
     vc_frontend_editor()->enqueueRequired();
     vc_include_template('editors/frontend_template.tpl.php', array('editor' => vc_frontend_editor()));
     die;
 }
开发者ID:k2jysy,项目名称:wedev,代码行数:17,代码来源:class-vc-templates-editor.php


示例14: vc_after_init

 public function vc_after_init()
 {
     //remove vc edit button from admin bar
     remove_action('admin_bar_menu', array(vc_frontend_editor(), 'adminBarEditLink'), 1000);
     //remove vc edit button from wp edit links
     remove_filter('edit_post_link', array(vc_frontend_editor(), 'renderEditButton'));
     //vc_disable_frontend(); // this will disable frontend editor
 }
开发者ID:de190909,项目名称:WPTest,代码行数:8,代码来源:class-shortcodes.php


示例15: renderFrontendDefaultTemplate

 /**
  * Load frontend default template content by index
  * @since 4.4
  */
 public function renderFrontendDefaultTemplate()
 {
     $template_index = (int) vc_post_param('template_unique_id');
     $data = $this->getDefaultTemplate($template_index);
     if (!$data) {
         die('Error: Vc_Templates_Panel_Editor::renderFrontendDefaultTemplate:1');
     }
     vc_frontend_editor()->setTemplateContent(trim($data['content']));
     vc_frontend_editor()->enqueueRequired();
     vc_include_template('editors/frontend_template.tpl.php', array('editor' => vc_frontend_editor()));
     die;
 }
开发者ID:rovak73,项目名称:sinfronterasdoc,代码行数:16,代码来源:class-vc-templates-panel-editor.php


示例16: new_vc

/**
 * New Vc now called Frontend editor
 * @deprecated 4.7
 * @return Vc_Frontend_Editor
 * @since 4.3
 */
function new_vc()
{
    _deprecated_function('new_vc', '4.7', 'vc_frontend_editor');
    return vc_frontend_editor();
}
开发者ID:arkev,项目名称:IntelligentMode,代码行数:11,代码来源:helpers_api.php


示例17: vc_remove_wp_admin_bar_button

function vc_remove_wp_admin_bar_button()
{
    remove_action('admin_bar_menu', array(vc_frontend_editor(), 'adminBarEditLink'), 1000);
}
开发者ID:nosval,项目名称:WPBlank,代码行数:4,代码来源:visual_composer.php


示例18: renderFrontendTemplate

 /**
  * Used to render template for frontend
  * @since 4.4
  *
  * @param $template_id
  * @param $template_type
  *
  * @return string|int
  */
 public function renderFrontendTemplate($template_id, $template_type)
 {
     if ($template_type == 'templatera_templates') {
         // do something to return output of templatera template
         $post = get_post($template_id);
         if ($post->post_type == self::$post_type) {
             set_vc_is_inline();
             // todo make sure we need this?
             vc_frontend_editor()->enqueueRequired();
             vc_frontend_editor()->setTemplateContent($post->post_content);
             vc_frontend_editor()->render('template');
             die;
         }
     }
     return $template_id;
 }
开发者ID:jfbelisle,项目名称:magexpress,代码行数:25,代码来源:vc_template_manager.php


示例19: loadInline

 /**
  * Get template content for frontend.
  * @deprecated since 4.4 we use VcTemplateManager::renderBackendTemplate and VcTemplateManager::renderFrontendTemplate
  */
 public function loadInline()
 {
     $post = !empty($_POST['template_id']) ? get_post($_POST['template_id']) : false;
     if (!$post || $post->post_type !== self::$post_type) {
         die;
     }
     set_vc_is_inline();
     vc_frontend_editor()->enqueueRequired();
     vc_frontend_editor()->setTemplateContent($post->post_content);
     vc_frontend_editor()->render('template');
     die;
 }
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:16,代码来源:vc_template_manager.php


示例20: vc_enabled_frontend

/**
 * Check is front end enabled.
 * @since 4.3
 * @return bool
 */
function vc_enabled_frontend()
{
    return vc_frontend_editor()->inlineEnabled();
}
开发者ID:syncopetwice,项目名称:STG,代码行数:9,代码来源:helpers_api.php



注:本文中的vc_frontend_editor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP vc_generate_dependencies_attributes函数代码示例发布时间:2022-05-23
下一篇:
PHP vc_extract_youtube_id函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap