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

PHP vc_set_default_editor_post_types函数代码示例

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

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



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

示例1: appica_vc_before_init

 /**
  * Setup Visual Composer for theme.
  *
  * Also, this function could be defined in theme "core" plugin.
  */
 function appica_vc_before_init()
 {
     vc_disable_frontend();
     vc_set_as_theme(true);
     // Allow post by default
     vc_set_default_editor_post_types(array('page', 'post', 'appica_portfolio'));
     // Set path to directory where Visual Composer should look for template files for content elements.
     $dir = get_template_directory() . '/inc/vc_templates';
     vc_set_shortcodes_templates_dir($dir);
 }
开发者ID:narendra-addweb,项目名称:m1,代码行数:15,代码来源:vc.php


示例2: jeg_vc_update

function jeg_vc_update()
{
    if (function_exists('vc_set_as_theme')) {
        vc_set_as_theme();
    }
    if (class_exists('WPBakeryVisualComposerAbstract')) {
        locate_template(array('admin/vc/extend.php'), true, true);
        locate_template(array('admin/vc/view.php'), true, true);
        locate_template(array('admin/vc/element.php'), true, true);
        vc_set_default_editor_post_types(array('page', 'portfolio'));
    }
}
开发者ID:OpenDoorBrewCo,项目名称:odbc-wp-prod,代码行数:12,代码来源:vc-integration.php


示例3: TS_VCSC_Widgets_Post_Compooser

 function TS_VCSC_Widgets_Post_Compooser()
 {
     if (function_exists('vc_editor_post_types') && function_exists('vc_set_default_editor_post_types') && function_exists('vc_settings')) {
         $TS_VCSC_ComposerContentTypes = vc_editor_post_types();
         $TS_VCSC_ComposerDefaultTypes = array();
         if (!in_array('ts_widgets', $TS_VCSC_ComposerContentTypes, true)) {
             foreach ($TS_VCSC_ComposerContentTypes as $value) {
                 array_push($TS_VCSC_ComposerDefaultTypes, $value);
             }
             array_push($TS_VCSC_ComposerDefaultTypes, 'ts_widgets');
             vc_set_default_editor_post_types($TS_VCSC_ComposerDefaultTypes);
             vc_settings()->set('content_types', $TS_VCSC_ComposerDefaultTypes);
         }
     }
 }
开发者ID:Telemedellin,项目名称:fonvalmed,代码行数:15,代码来源:ts_vcsc_custom_post_registration.php


示例4: visual_composer_stuff

 function visual_composer_stuff()
 {
     //enable vc on post types
     if (function_exists('vc_set_default_editor_post_types')) {
         vc_set_default_editor_post_types(array('post', 'page', 'product', 'portfolio'));
     }
     if (function_exists('vc_set_as_theme')) {
         vc_set_as_theme(true);
     }
     //vc_disable_frontend();
     // Modify and remove existing shortcodes from VC
     include_once 'inc/shortcodes/visual-composer/custom_vc.php';
     // VC Templates
     $vc_templates_dir = get_template_directory() . '/inc/shortcodes/visual-composer/vc_templates/';
     vc_set_template_dir($vc_templates_dir);
     // Add new shortcodes to VC
     include_once 'inc/shortcodes/visual-composer/from-the-blog.php';
     include_once 'inc/shortcodes/visual-composer/social-media-profiles.php';
     include_once 'inc/shortcodes/visual-composer/google-map.php';
     include_once 'inc/shortcodes/visual-composer/banner.php';
     include_once 'inc/shortcodes/visual-composer/icon-box.php';
     include_once 'inc/shortcodes/visual-composer/portfolio.php';
     // Add new Shop shortcodes to VC
     if (class_exists('WooCommerce')) {
         include_once 'inc/shortcodes/visual-composer/wc-recent-products.php';
         include_once 'inc/shortcodes/visual-composer/wc-featured-products.php';
         include_once 'inc/shortcodes/visual-composer/wc-products-by-category.php';
         include_once 'inc/shortcodes/visual-composer/wc-products-by-attribute.php';
         include_once 'inc/shortcodes/visual-composer/wc-product-by-id-sku.php';
         include_once 'inc/shortcodes/visual-composer/wc-products-by-ids-skus.php';
         include_once 'inc/shortcodes/visual-composer/wc-sale-products.php';
         include_once 'inc/shortcodes/visual-composer/wc-top-rated-products.php';
         include_once 'inc/shortcodes/visual-composer/wc-best-selling-products.php';
         include_once 'inc/shortcodes/visual-composer/wc-add-to-cart-button.php';
         include_once 'inc/shortcodes/visual-composer/wc-product-categories.php';
         include_once 'inc/shortcodes/visual-composer/wc-product-categories-grid.php';
     }
     // Remove vc_teaser
     if (is_admin()) {
         function remove_vc_teaser()
         {
             remove_meta_box('vc_teaser', '', 'side');
         }
         add_action('admin_head', 'remove_vc_teaser');
     }
 }
开发者ID:shwetadubey,项目名称:upfit,代码行数:46,代码来源:functions.php


示例5: execute

 public static function execute()
 {
     if (!class_exists('Vc_Manager', false)) {
         return;
     }
     if (function_exists('vc_set_as_theme')) {
         vc_set_as_theme(true);
     }
     if (function_exists('vc_set_default_editor_post_types')) {
         vc_set_default_editor_post_types(apply_filters('presscore_mod_js_composer_default_editor_post_types', array('page', 'post')));
     }
     if (function_exists('vc_set_shortcodes_templates_dir')) {
         vc_set_shortcodes_templates_dir(PRESSCORE_THEME_DIR . '/inc/shortcodes/vc_templates');
     }
     require_once locate_template('/inc/shortcodes/vc-extensions.php');
     add_action('init', array(__CLASS__, 'load_bridge'), 20);
     add_action('admin_enqueue_scripts', array(__CLASS__, 'load_admin_static'), 20);
     add_action('admin_init', array(__CLASS__, 'remove_teaser_meta_box'), 7);
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:19,代码来源:class-compatibility-vc.php


示例6: init

 /**
  * Functions that run on init
  *
  * @since 2.0.0
  */
 public function init()
 {
     // Override editor logo
     add_filter('vc_nav_front_logo', array($this, 'nav_logo'));
     // Remove templatera notice
     remove_action('admin_notices', 'templatera_notice');
     // Set defaults for admin
     if (function_exists('vc_set_default_editor_post_types')) {
         vc_set_default_editor_post_types(array('page', 'portfolio', 'staff', 'templatera'));
     }
     // Set defaults for editor
     if (function_exists('vc_editor_set_post_types ')) {
         $types = vc_settings()->get('content_types');
         if (empty($types)) {
             vc_editor_set_post_types(array('page', 'portfolio', 'staff'));
         }
     }
     // Array of elements to remove
     $elements = array('vc_teaser_grid', 'vc_posts_grid', 'vc_posts_slider', 'vc_carousel', 'vc_gallery', 'vc_wp_text', 'vc_wp_pages', 'vc_wp_links', 'vc_wp_categories', 'vc_wp_meta', 'vc_images_carousel');
     // Add filter for child theme tweaking
     $elements = apply_filters('wpex_vc_remove_elements', $elements);
     // Loop through elements to remove and remove them
     if (is_array($elements)) {
         foreach ($elements as $element) {
             vc_remove_element($element);
         }
     }
     // Add param to tabs
     vc_add_param('vc_tabs', array('type' => 'dropdown', 'heading' => esc_html__('Style', 'total'), 'param_name' => 'style', 'value' => array(esc_html__('Default', 'total') => 'default', esc_html__('Alternative #1', 'total') => 'alternative-one', esc_html__('Alternative #2', 'total') => 'alternative-two')));
     // Add param Tours
     vc_add_param('vc_tour', array('type' => 'dropdown', 'heading' => esc_html__('Style', 'total'), 'param_name' => 'style', 'value' => array(esc_html__('Default', 'total') => 'default', esc_html__('Alternative #1', 'total') => 'alternative-one', esc_html__('Alternative #2', 'total') => 'alternative-two')));
     // Include custom modules
     if (function_exists('vc_lean_map') && wpex_get_mod('extend_visual_composer', true)) {
         $this->total_custom_vc_shortcodes();
     }
 }
开发者ID:iq007,项目名称:MadScape,代码行数:41,代码来源:vc-config.php


示例7: init

 /**
  * Alter default post types
  *
  * @since 2.0.0
  */
 public function init()
 {
     // Remove templatera notice
     remove_action('admin_notices', 'templatera_notice');
     // Set as theme mode
     if (function_exists('vc_set_as_theme') && $this->vc_theme_mode) {
         vc_set_as_theme(true);
     }
     // Set defaults for admin
     if (function_exists('vc_set_default_editor_post_types')) {
         vc_set_default_editor_post_types(array('page', 'portfolio', 'staff'));
     }
     // Set defaults for editor
     if (function_exists('vc_editor_set_post_types ')) {
         $types = vc_settings()->get('content_types');
         if (empty($types)) {
             vc_editor_set_post_types(array('page', 'portfolio', 'staff'));
         }
     }
     // Array of elements to remove
     $elements = array('vc_teaser_grid', 'vc_posts_grid', 'vc_posts_slider', 'vc_carousel', 'vc_gallery', 'vc_wp_text', 'vc_wp_pages', 'vc_wp_links', 'vc_wp_categories', 'vc_wp_meta', 'vc_images_carousel');
     // Add filter for child theme tweaking
     $elements = apply_filters('wpex_vc_remove_elements', $elements);
     // Loop through elements to remove and remove them
     if (is_array($elements)) {
         foreach ($elements as $element) {
             vc_remove_element($element);
         }
     }
     // Add param to tabs
     vc_add_param('vc_tabs', array('type' => 'dropdown', 'heading' => __('Style', 'wpex'), 'param_name' => 'style', 'value' => array(__('Default', 'wpex') => 'default', __('Alternative #1', 'wpex') => 'alternative-one', __('Alternative #2', 'wpex') => 'alternative-two')));
     // Add param Tours
     vc_add_param('vc_tour', array('type' => 'dropdown', 'heading' => __('Style', 'wpex'), 'param_name' => 'style', 'value' => array(__('Default', 'wpex') => 'default', __('Alternative #1', 'wpex') => 'alternative-one', __('Alternative #2', 'wpex') => 'alternative-two')));
     // Add param Custom Heading
     vc_add_param('vc_custom_heading', array('type' => 'dropdown', 'heading' => __('Enqueue Font Style', 'wpex'), 'param_name' => 'enqueue_font_style', 'value' => array(__('Yes', 'wpex') => 'true', __('No', 'wpex') => 'false'), 'descriptipn' => __('If the Google Font you are using is already in use by the theme select No to prevent this font from loading again on the site.', 'wpex')));
 }
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:41,代码来源:vc-config.php


示例8: get_template_directory

require_once get_template_directory() . '/framework/functions/blog-functions.php';
// Blog related functions
require_once get_template_directory() . '/framework/functions/page-functions.php';
// Page functions & metaboxes
require_once get_template_directory() . '/framework/functions/header-functions.php';
// Header related functions
require_once get_template_directory() . '/framework/widgets/widgets.php';
// Widgets
// Visual Composer:
if (class_exists('Vc_Manager')) {
    function waxom_extend_composer()
    {
        require_once get_template_directory() . '/wpbakery/vc-extend.php';
    }
    $list = array('page', 'post', 'portfolio');
    vc_set_default_editor_post_types($list);
    add_action('init', 'waxom_extend_composer', 20);
}
// Theme Options / Redux Framework
if (!class_exists('ReduxFramework') && file_exists(get_template_directory() . '/framework/theme-panel/ReduxCore/framework.php')) {
    require_once get_template_directory() . '/framework/theme-panel/ReduxCore/framework.php';
}
if (!isset($redux_demo) && file_exists(get_template_directory() . '/framework/theme-panel/waxom/waxom-config.php')) {
    require_once get_template_directory() . '/framework/theme-panel/waxom/waxom-config.php';
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//		Localization
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function waxom_theme_setup()
{
    load_theme_textdomain('waxom', get_template_directory() . '/lang');
开发者ID:siiiiilvio,项目名称:kadcnc,代码行数:31,代码来源:functions.php


示例9: add_action

<?php

add_action('vc_before_init', 'stm_vc_set_as_theme');
function stm_vc_set_as_theme()
{
    vc_set_as_theme(true);
}
if (function_exists('vc_set_default_editor_post_types')) {
    vc_set_default_editor_post_types(array('page', 'post', 'service', 'project', 'sidebar'));
}
if (is_admin()) {
    if (!function_exists('stm_vc_remove_teaser_metabox')) {
        function stm_vc_remove_teaser_metabox()
        {
            $post_types = get_post_types('', 'names');
            foreach ($post_types as $post_type) {
                remove_meta_box('vc_teaser', $post_type, 'side');
            }
        }
        add_action('do_meta_boxes', 'stm_vc_remove_teaser_metabox');
    }
}
add_action('admin_init', 'stm_update_existing_shortcodes');
function stm_update_existing_shortcodes()
{
    if (function_exists('vc_add_params')) {
        vc_add_params('vc_gallery', array(array('type' => 'dropdown', 'heading' => __('Gallery type', STM_DOMAIN), 'param_name' => 'type', 'value' => array(__('Image grid', STM_DOMAIN) => 'image_grid', __('Slick slider', STM_DOMAIN) => 'slick_slider', __('Slick slider 2', STM_DOMAIN) => 'slick_slider_2')), array('type' => 'textfield', 'heading' => __('Thumbnail size', STM_DOMAIN), 'param_name' => 'thumbnail_size', 'dependency' => array('element' => 'type', 'value' => array('slick_slider_2'))), array('type' => 'css_editor', 'heading' => __('Css', STM_DOMAIN), 'param_name' => 'css', 'group' => __('Design options', STM_DOMAIN))));
        vc_add_params('vc_column_inner', array(array('type' => 'column_offset', 'heading' => __('Responsiveness', 'js_composer'), 'param_name' => 'offset', 'group' => __('Width & Responsiveness', 'js_composer'), 'description' => __('Adjust column for different screen sizes. Control width, offset and visibility settings.', 'js_composer'))));
        vc_add_params('vc_separator', array(array('type' => 'dropdown', 'heading' => __('Type', STM_DOMAIN), 'param_name' => 'type', 'value' => array(__('Type 1', STM_DOMAIN) => 'type_1', __('Type 2', STM_DOMAIN) => 'type_2')), array('type' => 'css_editor', 'heading' => __('Css', STM_DOMAIN), 'param_name' => 'css', 'group' => __('Design options', STM_DOMAIN))));
        vc_add_params('vc_video', array(array('type' => 'textfield', 'heading' => __('Iframe Link', STM_DOMAIN), 'param_name' => 'link'), array('type' => 'attach_image', 'heading' => __('Preview Image', STM_DOMAIN), 'param_name' => 'image')));
        vc_add_params('vc_wp_pages', array(array('type' => 'css_editor', 'heading' => __('Css', STM_DOMAIN), 'param_name' => 'css', 'group' => __('Design options', STM_DOMAIN))));
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:31,代码来源:visual_composer.php


示例10: add_action

require_once 'stm_elements/volunteer_join_us_button.php';
require_once 'stm_elements/blog_list.php';
require_once 'stm_elements/testimonials.php';
require_once 'stm_elements/gallery.php';
require_once 'stm_elements/info_box.php';
require_once 'stm_elements/google_map.php';
add_action('vc_before_init', 'stm_vcSetAsTheme');
function stm_vcSetAsTheme()
{
    vc_set_as_theme(true);
}
if (function_exists('vc_set_shortcodes_templates_dir')) {
    vc_set_shortcodes_templates_dir(get_template_directory() . '/inc/visual_composer/vc_templates');
}
if (function_exists('vc_set_default_editor_post_types')) {
    vc_set_default_editor_post_types(array('page', 'post', 'event', 'donation'));
}
if (is_admin()) {
    if (!function_exists('stm_vc_remove_teaser_metabox')) {
        function stm_vc_remove_teaser_metabox()
        {
            $post_types = get_post_types('', 'names');
            foreach ($post_types as $post_type) {
                remove_meta_box('vc_teaser', $post_type, 'side');
            }
        }
        add_action('do_meta_boxes', 'stm_vc_remove_teaser_metabox');
    }
}
function stm_update_existing_shortcodes()
{
开发者ID:bogdandobritoiu,项目名称:aripi,代码行数:31,代码来源:visual_composer.php


示例11: init

 /**
  * Initialize plugin data
  * @return VcTemplateManager
  */
 function init()
 {
     if ($this->init) {
         return $this;
     }
     // Disable double initialization.
     $this->init = true;
     if (current_user_can('manage_options') && isset($_GET['action']) && $_GET['action'] === 'export_templatera') {
         $id = isset($_GET['id']) ? $_GET['id'] : null;
         add_action('wp_loaded', array_map(array(&$this, 'export'), array($id)));
     } elseif (current_user_can('manage_options') && isset($_GET['action']) && $_GET['action'] === 'import_templatera') {
         add_action('wp_loaded', array(&$this, 'import'));
     }
     $this->createPostType();
     $this->initPluginLoaded();
     // init filters/actions and hooks
     // Add vc template post type into the list of allowed post types for visual composer.
     if ($this->isValidPostType()) {
         $pt_array = get_option('wpb_js_content_types');
         if (!is_array($pt_array) || empty($pt_array)) {
             $pt_array = array(self::postType(), 'page');
             update_option('wpb_js_content_types', $pt_array);
         } elseif (!in_array(self::postType(), $pt_array)) {
             $pt_array[] = self::postType();
             update_option('wpb_js_content_types', $pt_array);
         }
         vc_set_default_editor_post_types(array('page', 'templatera'));
         vc_editor_set_post_types(vc_editor_post_types() + array('templatera'));
         add_action('admin_init', array(&$this, 'createMetaBox'), 1);
         add_filter('vc_role_access_with_post_types_get_state', '__return_true');
         add_filter('vc_role_access_with_backend_editor_get_state', '__return_true');
         add_filter('vc_role_access_with_frontend_editor_get_state', '__return_true');
         add_filter('vc_check_post_type_validation', '__return_true');
     }
     add_action('wp_loaded', array($this, 'createShortcode'));
     return $this;
     // chaining.
 }
开发者ID:siiiiilvio,项目名称:kadcnc,代码行数:42,代码来源:vc_template_manager.php


示例12: TheShortcodesForVC

function TheShortcodesForVC()
{
    if (!class_exists('WPBakeryVisualComposerAbstract')) {
        // or using plugins path function
        return;
    }
    // Remove Front End
    vc_disable_frontend();
    // Set as Theme
    WPBakeryVisualComposerAbstract::$config['USER_DIR_NAME'] = 'inc/shortcodes';
    vc_set_default_editor_post_types(array('post', 'page', 'product'));
    vc_set_as_theme(true);
    // Removing Default shortcodes
    vc_remove_element("vc_widget_sidebar");
    vc_remove_element("vc_wp_search");
    vc_remove_element("vc_wp_meta");
    vc_remove_element("vc_wp_recentcomments");
    vc_remove_element("vc_wp_calendar");
    vc_remove_element("vc_wp_pages");
    vc_remove_element("vc_wp_tagcloud");
    vc_remove_element("vc_wp_custommenu");
    vc_remove_element("vc_wp_text");
    vc_remove_element("vc_wp_posts");
    vc_remove_element("vc_wp_links");
    vc_remove_element("vc_wp_categories");
    vc_remove_element("vc_wp_archives");
    vc_remove_element("vc_wp_rss");
    vc_remove_element("vc_teaser_grid");
    vc_remove_element("vc_button");
    vc_remove_element("vc_button2");
    vc_remove_element("vc_cta_button");
    vc_remove_element("vc_message");
    vc_remove_element("vc_progress_bar");
    vc_remove_element("vc_pie");
    vc_remove_element("vc_posts_slider");
    vc_remove_element("vc_posts_grid");
    vc_remove_element("vc_images_carousel");
    vc_remove_element("vc_carousel");
    vc_remove_element("vc_gallery");
    vc_remove_element("vc_single_image");
    vc_remove_element("vc_facebook");
    vc_remove_element("vc_tweetmeme");
    vc_remove_element("vc_googleplus");
    vc_remove_element("vc_pinterest");
    vc_remove_element("vc_single_image");
    vc_remove_element("vc_cta_button2");
    vc_remove_element("vc_gmaps");
    vc_remove_element("vc_raw_js");
    vc_remove_element("vc_flickr");
    vc_remove_element("vc_separator");
    vc_remove_element("vc_text_separator");
    vc_remove_element("vc_empty_space");
    vc_remove_element("vc_custom_heading");
    add_action('admin_head', 'remove_my_meta_box');
    function remove_my_meta_box()
    {
        remove_meta_box("vc_teaser", "portfolio", "side");
        remove_meta_box("vc_teaser", "page", "side");
        remove_meta_box("vc_teaser", "product", "side");
    }
    // Shortcodes
    require_once 'visualcomposer-extend.php';
    /* Columns */
    function thb_translateColumnWidthToSpan($width)
    {
        switch ($width) {
            case "1/6":
                $w = "medium-2";
                break;
            case "1/4":
                $w = "medium-3";
                break;
            case "1/3":
                $w = "medium-4";
                break;
            case "2/4":
                $w = "medium-6";
            case "1/2":
                $w = "medium-6";
                break;
            case "4/6":
                $w = "medium-8";
                break;
            case "2/3":
                $w = "medium-8";
                break;
            case "3/4":
                $w = "medium-9";
                break;
            case "10/12":
                $w = "medium-10";
                break;
            case "5/6":
                $w = "medium-10";
                break;
            case "1/1":
                $w = "medium-12";
                break;
            case "1/12":
                $w = "medium-1";
//.........这里部分代码省略.........
开发者ID:ardiqghenatya,项目名称:web4,代码行数:101,代码来源:visualcomposer.php


示例13: vc_automapper

     }
     // Disable shortcode automapper feature
     if (!$nm_vcomp_stock) {
         if (function_exists('vc_automapper')) {
             vc_automapper()->setDisabled(true);
         }
     }
     /* Remove "vc_teaser" metabox */
     function nm_vc_remove_teaser_metabox()
     {
         remove_meta_box('vc_teaser', '', 'side');
     }
     add_action('admin_head', 'nm_vc_remove_teaser_metabox');
     // Set default editor post types (will not be used if the "content_types" VC setting is already saved - see fix below)
     $post_types = array('page');
     vc_set_default_editor_post_types($post_types);
     // Default editor post types: Un-comment and refresh WP admin to save/reset the "content_types" VC option
     // NOTE: Remember to comment-out after page refresh!
     //vc_settings()->set( 'content_types', $post_types );
 }
 /* Remove header meta tag */
 function nm_vc_remove_meta()
 {
     remove_action('wp_head', array(visual_composer(), 'addMetaData'));
 }
 add_action('init', 'nm_vc_remove_meta', 100);
 /*
  * VC: Output custom styles - Visual Composer doesn't output custom styles on non-singular pages (like blog-index and shop archives)
  *
  * See "addFrontCss()" in "../js_composer/include/classes/core/class-vc-base.php"
  */
开发者ID:tccyp001,项目名称:onemore-wordpress,代码行数:31,代码来源:init.php


示例14: rt_vc_set_default_editor_post_types

function rt_vc_set_default_editor_post_types()
{
    $list = array('page', 'portfolio');
    vc_set_default_editor_post_types($list);
}
开发者ID:ryan-konkolewski,项目名称:rt-theme-19-extentions-multisite,代码行数:5,代码来源:visual_composer_config.php


示例15: axiom_shortcodes_vc_theme_setup

    function axiom_shortcodes_vc_theme_setup()
    {
        if (axiom_shortcodes_is_used()) {
            // Set VC as main editor for the theme
            vc_set_as_theme(true);
            // Enable VC on follow post types
            vc_set_default_editor_post_types(array('page', 'team'));
            // Disable frontend editor
            //vc_disable_frontend();
            // Load scripts and styles for VC support
            add_action('wp_enqueue_scripts', 'axiom_shortcodes_vc_scripts_front');
            add_action('admin_enqueue_scripts', 'axiom_shortcodes_vc_scripts_admin');
            // Add init script into shortcodes output in VC frontend editor
            add_filter('axiom_shortcode_output', 'axiom_shortcodes_vc_add_init_script', 10, 4);
            // Remove standard VC shortcodes
            vc_remove_element("vc_button");
            vc_remove_element("vc_posts_slider");
            vc_remove_element("vc_gmaps");
            vc_remove_element("vc_teaser_grid");
            vc_remove_element("vc_progress_bar");
            vc_remove_element("vc_facebook");
            vc_remove_element("vc_tweetmeme");
            vc_remove_element("vc_googleplus");
            vc_remove_element("vc_facebook");
            vc_remove_element("vc_pinterest");
            vc_remove_element("vc_message");
            vc_remove_element("vc_posts_grid");
            vc_remove_element("vc_carousel");
            vc_remove_element("vc_flickr");
            vc_remove_element("vc_tour");
            vc_remove_element("vc_separator");
            vc_remove_element("vc_single_image");
            vc_remove_element("vc_cta_button");
            //			vc_remove_element("vc_accordion");
            //			vc_remove_element("vc_accordion_tab");
            vc_remove_element("vc_toggle");
            vc_remove_element("vc_tabs");
            vc_remove_element("vc_tab");
            vc_remove_element("vc_images_carousel");
            // Remove standard WP widgets
            vc_remove_element("vc_wp_archives");
            vc_remove_element("vc_wp_calendar");
            vc_remove_element("vc_wp_categories");
            vc_remove_element("vc_wp_custommenu");
            vc_remove_element("vc_wp_links");
            vc_remove_element("vc_wp_meta");
            vc_remove_element("vc_wp_pages");
            vc_remove_element("vc_wp_posts");
            vc_remove_element("vc_wp_recentcomments");
            vc_remove_element("vc_wp_rss");
            vc_remove_element("vc_wp_search");
            vc_remove_element("vc_wp_tagcloud");
            vc_remove_element("vc_wp_text");
            global $AXIOM_GLOBALS;
            $AXIOM_GLOBALS['vc_params'] = array('category' => __("AxiomThemes shortcodes", "axiom"), 'id' => array("param_name" => "id", "heading" => __("Element ID", "axiom"), "description" => __("ID for current element", "axiom"), "group" => __('Size &amp; Margins', 'axiom'), "value" => "", "type" => "textfield"), 'class' => array("param_name" => "class", "heading" => __("Element CSS class", "axiom"), "description" => __("CSS class for current element", "axiom"), "group" => __('Size &amp; Margins', 'axiom'), "value" => "", "type" => "textfield"), 'animation' => array("param_name" => "animation", "heading" => __("Animation", "axiom"), "description" => __("Select animation while object enter in the visible area of page", "axiom"), "class" => "", "value" => array_flip($AXIOM_GLOBALS['sc_params']['animations']), "type" => "dropdown"), 'css' => array("param_name" => "css", "heading" => __("CSS styles", "axiom"), "description" => __("Any additional CSS rules (if need)", "axiom"), "group" => __('Size &amp; Margins', 'axiom'), "class" => "", "value" => "", "type" => "textfield"), 'margin_top' => array("param_name" => "top", "heading" => __("Top margin", "axiom"), "description" => __("Top margin (in pixels).", "axiom"), "group" => __('Size &amp; Margins', 'axiom'), "value" => "", "type" => "textfield"), 'margin_bottom' => array("param_name" => "bottom", "heading" => __("Bottom margin", "axiom"), "description" => __("Bottom margin (in pixels).", "axiom"), "group" => __('Size &amp; Margins', 'axiom'), "value" => "", "type" => "textfield"), 'margin_left' => array("param_name" => "left", "heading" => __("Left margin", "axiom"), "description" => __("Left margin (in pixels).", "axiom"), "group" => __('Size &amp; Margins', 'axiom'), "value" => "", "type" => "textfield"), 'margin_right' => array("param_name" => "right", "heading" => __("Right margin", "axiom"), "description" => __("Right margin (in pixels).", "axiom"), "group" => __('Size &amp; Margins', 'axiom'), "value" => "", "type" => "textfield"));
            // Accordion
            //-------------------------------------------------------------------------------------
            vc_map(array("base" => "trx_accordion", "name" => __("Accordion", "axiom"), "description" => __("Accordion items", "axiom"), "category" => __('Content', 'js_composer'), 'icon' => 'icon_trx_accordion', "class" => "trx_sc_collection trx_sc_accordion", "content_element" => true, "is_container" => true, "show_settings_on_create" => false, "as_parent" => array('only' => 'trx_accordion_item'), "params" => array(array("param_name" => "style", "heading" => __("Accordion style", "axiom"), "description" => __("Select style for display accordion", "axiom"), "class" => "", "admin_label" => true, "value" => array(__('Style 1', 'axiom') => 1, __('Style 2', 'axiom') => 2), "type" => "dropdown"), array("param_name" => "counter", "heading" => __("Counter", "axiom"), "description" => __("Display counter before each accordion title", "axiom"), "class" => "", "value" => array("Add item numbers before each element" => "on"), "type" => "checkbox"), array("param_name" => "initial", "heading" => __("Initially opened item", "axiom"), "description" => __("Number of initially opened item", "axiom"), "class" => "", "value" => 1, "type" => "textfield"), array("param_name" => "icon_closed", "heading" => __("Icon while closed", "axiom"), "description" => __("Select icon for the closed accordion item from Fontello icons set", "axiom"), "class" => "", "value" => $AXIOM_GLOBALS['sc_params']['icons'], "type" => "dropdown"), array("param_name" => "icon_opened", "heading" => __("Icon while opened", "axiom"), "description" => __("Select icon for the opened accordion item from Fontello icons set", "axiom"), "class" => "", "value" => $AXIOM_GLOBALS['sc_params']['icons'], "type" => "dropdown"), $AXIOM_GLOBALS['vc_params']['margin_top'], $AXIOM_GLOBALS['vc_params']['margin_bottom'], $AXIOM_GLOBALS['vc_params']['margin_left'], $AXIOM_GLOBALS['vc_params']['margin_right'], $AXIOM_GLOBALS['vc_params']['id'], $AXIOM_GLOBALS['vc_params']['class'], $AXIOM_GLOBALS['vc_params']['animation'], $AXIOM_GLOBALS['vc_params']['css']), 'default_content' => '
					[trx_accordion_item title="' . __('Item 1 title', 'axiom') . '"][/trx_accordion_item]
					[trx_accordion_item title="' . __('Item 2 title', 'axiom') . '"][/trx_accordion_item]
				', "custom_markup" => '
					<div class="wpb_accordion_holder wpb_holder clearfix vc_container_for_children">
						%content%
					</div>
					<div class="tab_controls">
						<button class="add_tab" title="' . __("Add item", "axiom") . '">' . __("Add item", "axiom") . '</button>
					</div>
				', 'js_view' => 'VcTrxAccordionView'));
            vc_map(array("base" => "trx_accordion_item", "name" => __("Accordion item", "axiom"), "description" => __("Inner accordion item", "axiom"), "show_settings_on_create" => true, "content_element" => true, "is_container" => true, 'icon' => 'icon_trx_accordion_item', "as_child" => array('only' => 'trx_accordion'), "as_parent" => array('except' => 'trx_accordion'), "params" => array(array("param_name" => "title", "heading" => __("Title", "axiom"), "description" => __("Title for current accordion item", "axiom"), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield"), array("param_name" => "icon_closed", "heading" => __("Icon while closed", "axiom"), "description" => __("Select icon for the closed accordion item from Fontello icons set", "axiom"), "class" => "", "value" => $AXIOM_GLOBALS['sc_params']['icons'], "type" => "dropdown"), array("param_name" => "icon_opened", "heading" => __("Icon while opened", "axiom"), "description" => __("Select icon for the opened accordion item from Fontello icons set", "axiom"), "class" => "", "value" => $AXIOM_GLOBALS['sc_params']['icons'], "type" => "dropdown"), $AXIOM_GLOBALS['vc_params']['id'], $AXIOM_GLOBALS['vc_params']['class'], $AXIOM_GLOBALS['vc_params']['css']), 'js_view' => 'VcTrxAccordionTabView'));
            class WPBakeryShortCode_Trx_Accordion extends AXIOM_VC_ShortCodeAccordion
            {
            }
            class WPBakeryShortCode_Trx_Accordion_Item extends AXIOM_VC_ShortCodeAccordionItem
            {
            }
            // Anchor
            //-------------------------------------------------------------------------------------
            vc_map(array("base" => "trx_anchor", "name" => __("Anchor", "axiom"), "description" => __("Insert anchor for the TOC (table of content)", "axiom"), "category" => __('Content', 'js_composer'), 'icon' => 'icon_trx_anchor', "class" => "trx_sc_single trx_sc_anchor", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array(array("param_name" => "icon", "heading" => __("Anchor's icon", "axiom"), "description" => __("Select icon for the anchor from Fontello icons set", "axiom"), "class" => "", "value" => $AXIOM_GLOBALS['sc_params']['icons'], "type" => "dropdown"), array("param_name" => "title", "heading" => __("Short title", "axiom"), "description" => __("Short title of the anchor (for the table of content)", "axiom"), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield"), array("param_name" => "description", "heading" => __("Long description", "axiom"), "description" => __("Description for the popup (then hover on the icon). You can use '{' and '}' - make the text italic, '|' - insert line break", "axiom"), "class" => "", "value" => "", "type" => "textfield"), array("param_name" => "url", "heading" => __("External URL", "axiom"), "description" => __("External URL for this TOC item", "axiom"), "class" => "", "value" => "", "type" => "textfield"), array("param_name" => "separator", "heading" => __("Add separator", "axiom"), "description" => __("Add separator under item in the TOC", "axiom"), "class" => "", "value" => array("Add separator" => "yes"), "type" => "checkbox"), $AXIOM_GLOBALS['vc_params']['id'])));
            class WPBakeryShortCode_Trx_Anchor extends AXIOM_VC_ShortCodeSingle
            {
            }
            // Audio
            //-------------------------------------------------------------------------------------
            vc_map(array("base" => "trx_audio", "name" => __("Audio", "axiom"), "description" => __("Insert audio player", "axiom"), "category" => __('Content', 'js_composer'), 'icon' => 'icon_trx_audio', "class" => "trx_sc_single trx_sc_audio", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array(array("param_name" => "url", "heading" => __("URL for audio file", "axiom"), "description" => __("Put here URL for audio file", "axiom"), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield"), array("param_name" => "image", "heading" => __("Cover image", "axiom"), "description" => __("Select or upload image or write URL from other site for audio cover", "axiom"), "class" => "", "value" => "", "type" => "attach_image"), array("param_name" => "title", "heading" => __("Title", "axiom"), "description" => __("Title of the audio file", "axiom"), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield"), array("param_name" => "author", "heading" => __("Author", "axiom"), "description" => __("Author of the audio file", "axiom"), "class" => "", "value" => "", "type" => "textfield"), array("param_name" => "controls", "heading" => __("Controls", "axiom"), "description" => __("Show/hide controls", "axiom"), "class" => "", "value" => array("Hide controls" => "hide"), "type" => "checkbox"), array("param_name" => "autoplay", "heading" => __("Autoplay", "axiom"), "description" => __("Autoplay audio on page load", "axiom"), "class" => "", "value" => array("Autoplay" => "on"), "type" => "checkbox"), array("param_name" => "align", "heading" => __("Alignment", "axiom"), "description" => __("Select block alignment", "axiom"), "class" => "", "value" => array_flip($AXIOM_GLOBALS['sc_params']['align']), "type" => "dropdown"), axiom_vc_width(), axiom_vc_height(), $AXIOM_GLOBALS['vc_params']['margin_top'], $AXIOM_GLOBALS['vc_params']['margin_bottom'], $AXIOM_GLOBALS['vc_params']['margin_left'], $AXIOM_GLOBALS['vc_params']['margin_right'], $AXIOM_GLOBALS['vc_params']['id'], $AXIOM_GLOBALS['vc_params']['class'], $AXIOM_GLOBALS['vc_params']['animation'], $AXIOM_GLOBALS['vc_params']['css'])));
            class WPBakeryShortCode_Trx_Audio extends AXIOM_VC_ShortCodeSingle
            {
            }
            // Block
            //-------------------------------------------------------------------------------------
            vc_map(array("base" => "trx_block", "name" => __("Block container", "axiom"), "description" => __("Container for any block ([section] analog - to enable nesting)", "axiom"), "category" => __('Content', 'js_composer'), 'icon' => 'icon_trx_block', "class" => "trx_sc_collection trx_sc_block", "content_element" => true, "is_container" => true, "show_settings_on_create" => true, "params" => array(array("param_name" => "dedicated", "heading" => __("Dedicated", "axiom"), "description" => __("Use this block as dedicated content - show it before post title on single page", "axiom"), "admin_label" => true, "class" => "", "value" => array(__('Use as dedicated content', 'axiom') => 'yes'), "type" => "checkbox"), array("param_name" => "align", "heading" => __("Alignment", "axiom"), "description" => __("Select block alignment", "axiom"), "class" => "", "value" => array_flip($AXIOM_GLOBALS['sc_params']['align']), "type" => "dropdown"), array("param_name" => "columns", "heading" => __("Columns emulation", "axiom"), "description&qu 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP vc_set_shortcodes_templates_dir函数代码示例发布时间:2022-05-23
下一篇:
PHP vc_set_as_theme函数代码示例发布时间: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