当前位置: 首页>>代码示例>>PHP>>正文


PHP vc_set_as_theme函数代码示例

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


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

示例1: hello_vcSetAsTheme

/**
 * Visual Composer init
 */
function hello_vcSetAsTheme()
{
    // Force Visual Composer to initialize as 'built into the theme'.
    // This will hide certain tabs under the Settings->Visual Composer page
    vc_set_as_theme();
    vc_map(array('name' => __('breadcrumb bar', 'hello'), 'base' => 'breadcrumb', 'class' => '', 'category' => __('Theme', 'hello'), 'show_settings_on_create' => false, 'params' => array()));
}
开发者ID:democracy-os-fr,项目名称:hello,代码行数:10,代码来源:plugins.php

示例2: mango_vcSetAsTheme

function mango_vcSetAsTheme()
{
    // Set Visual Composer
    if (function_exists('vc_set_as_theme')) {
        vc_set_as_theme();
    }
}
开发者ID:nickkoskowski,项目名称:Work-Depot,代码行数:7,代码来源:plugins.php

示例3: wf_vc_setup

function wf_vc_setup()
{
    // Declare Theme Integration
    vc_set_as_theme();
    // Templates Directory
    $dir = plugin_dir_path(dirname(__FILE__) . 'includes/vc/templates');
    vc_set_shortcodes_templates_dir($dir);
}
开发者ID:prosatya,项目名称:WF-Gmap,代码行数:8,代码来源:vc-config.php

示例4: x_visual_composer_set_as_theme

function x_visual_composer_set_as_theme()
{
    if (get_option('wpb_js_x_hide_design_options', true) && x_visual_composer_integration_on()) {
        vc_set_as_theme(true);
    } else {
        add_action('admin_notices', 'x_visual_composer_hide_update_notice', -99);
        vc_manager()->disableUpdater();
    }
}
开发者ID:kevinotsuka,项目名称:datapop,代码行数:9,代码来源:visual-composer.php

示例5: init

 /**
  * Run on init
  */
 public function init()
 {
     // Set the visual composer to run in theme mod
     if (function_exists('vc_set_as_theme') && get_theme_mod('visual_composer_theme_mode', true)) {
         vc_set_as_theme($disable_updater = true);
     }
     // Remove elements
     $this->remove_elements();
 }
开发者ID:sergey-h,项目名称:naman2,代码行数:12,代码来源:visual-composer.php

示例6: 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

示例7: 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

示例8: ewf_load_composer

function ewf_load_composer()
{
    if (function_exists('vc_set_as_theme')) {
        vc_set_as_theme();
    }
    if (function_exists('vc_set_template_dir')) {
        $dir = get_template_directory() . '/framework/composer/templates/';
        vc_set_template_dir($dir);
    }
    if (function_exists('vc_disable_frontend')) {
        vc_disable_frontend();
    }
    add_filter('vc_shortcodes_css_class', 'ewf_composer_custom_classes', 10, 2);
}
开发者ID:narendra-addweb,项目名称:SwitchedOn,代码行数:14,代码来源:components.php

示例9: visual_composer_stuff

 function visual_composer_stuff()
 {
     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/banner.php';
     include_once 'inc/shortcodes/visual-composer/title.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';
     }
     // Add new Options
     function add_vc_text_separator_no_border()
     {
         $param = WPBMap::getParam('vc_text_separator', 'style');
         $param['value'][__('No Border', 'mr_tailor')] = 'no_border';
         WPBMap::mutateParam('vc_text_separator', $param);
     }
     add_action('init', 'add_vc_text_separator_no_border');
     // Remove vc_teaser
     if (is_admin()) {
         function remove_vc_teaser()
         {
             remove_meta_box('vc_teaser', '', 'side');
         }
         add_action('admin_head', 'remove_vc_teaser');
     }
 }
开发者ID:quyendam2612,项目名称:quanao,代码行数:48,代码来源:functions.php

示例10: mk_set_vc_as_theme

function mk_set_vc_as_theme()
{
    vc_set_as_theme($disable_updater = true);
    if (defined('MODIFIED_VC_ACTIVATED')) {
        $child_dir = get_stylesheet_directory() . '/shortcodes';
        $parent_dir = get_template_directory() . '/shortcodes';
        vc_set_shortcodes_parent_templates_dir($parent_dir);
        vc_set_shortcodes_templates_dir($child_dir);
    } else {
        $child_dir = get_template_directory() . '/shortcodes';
        $parent_dir = get_template_directory() . '/shortcodes';
        vc_set_shortcodes_templates_dir($parent_dir);
        vc_set_shortcodes_templates_dir($child_dir);
    }
    vc_disable_frontend();
}
开发者ID:namleduc,项目名称:thqc,代码行数:16,代码来源:vc-integration.php

示例11: nectar_set_vc_as_theme

function nectar_set_vc_as_theme()
{
    vc_set_as_theme($disable_updater = true);
    if (defined('SALIENT_VC_ACTIVE')) {
        $child_dir = get_stylesheet_directory() . '/nectar/nectar-vc-addons/vc_templates';
        $parent_dir = get_template_directory() . '/nectar/nectar-vc-addons/vc_templates';
        vc_set_shortcodes_templates_dir($parent_dir);
        vc_set_shortcodes_templates_dir($child_dir);
    } else {
        $child_dir = get_template_directory() . '/nectar/nectar-vc-addons/vc_templates';
        $parent_dir = get_template_directory() . '/nectar/nectar-vc-addons/vc_templates';
        vc_set_shortcodes_templates_dir($parent_dir);
        vc_set_shortcodes_templates_dir($child_dir);
    }
    vc_disable_frontend();
}
开发者ID:ryuqing,项目名称:cake,代码行数:16,代码来源:nectar-addons.php

示例12: __construct

 /**
  * Start things up
  *
  * @since 1.6.0
  */
 public function __construct()
 {
     // Include helper functions and classes
     require_once WPEX_FRAMEWORK_DIR . 'visual-composer/vc-helpers.php';
     // Remove design options tab
     if (apply_filters('wpex_remove_vc_design_options', true)) {
         add_filter('vc_settings_page_show_design_tabs', '__return_false');
         delete_option('wpb_js_use_custom');
     }
     // Set theme mode and disable updater
     if (wpex_get_mod('visual_composer_theme_mode', true) && function_exists('vc_set_as_theme')) {
         $disable_updater = true;
         vc_set_as_theme($disable_updater);
         // This is no longer needed since VC 4.4 it seems
         //add_action( 'admin_init', array( $this, 'disable_updater' ), 99 );
     }
     // Run on init
     add_action('init', array($this, 'init'), 20);
     // Tweak scripts
     add_action('wp_enqueue_scripts', array($this, 'load_composer_front_css'), 0);
     add_action('wp_enqueue_scripts', array($this, 'load_remove_styles'));
     add_action('wp_footer', array($this, 'remove_footer_scripts'));
     add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
     // Remove welcome admin panel
     add_action('admin_menu', array(__CLASS__, 'remove_welcome'), 999);
     // Load Visual Composer meta CSS for footer builder, topbar, etc.
     add_action('wpex_head_css', array($this, 'vc_css_ids'));
     // Alter the allowed font tags and fonts
     add_filter('vc_font_container_get_allowed_tags', array($this, 'font_container_tags'));
     add_filter('vc_font_container_get_fonts_filter', array($this, 'font_container_fonts'));
     // Alter default templates
     add_filter('vc_load_default_templates', array($this, 'default_templates'));
     // Remove VC welcome screen
     remove_action('vc_activation_hook', 'vc_page_welcome_set_redirect');
     remove_action('init', 'vc_page_welcome_redirect');
     // Register accent colors
     add_filter('wpex_accent_texts', array($this, 'accent_texts'));
     add_filter('wpex_accent_borders', array($this, 'accent_borders'));
     add_filter('wpex_accent_backgrounds', array($this, 'accent_backgrounds'));
     // Add new parameter types
     if (function_exists('vc_add_shortcode_param')) {
         vc_add_shortcode_param('vcex_textarea_html', array($this, 'vcex_textarea_html'));
     } else {
         add_shortcode_param('vcex_textarea_html', array($this, 'vcex_textarea_html'));
     }
 }
开发者ID:iq007,项目名称:MadScape,代码行数:51,代码来源:vc-config.php

示例13: 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

示例14: 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

示例15: webnus_register_required_plugins

 * In this example, we register two plugins - one included with the TGMPA library
 * and one from the .org repo.
 *
 * The variable passed to tgmpa_register_plugins() should be an array of plugin
 * arrays.
 *
 * This function is hooked into tgmpa_init, which is fired within the
 * TGM_Plugin_Activation class constructor.
 */
function webnus_register_required_plugins()
{
    /**
     * Array of plugin arrays. Required keys are name and slug.
     * If the source is NOT from the .org repo, then source is also required.
     */
    $plugins = array(array('name' => 'Woocommerce', 'slug' => 'woocommerce', 'required' => false), array('name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false), array('name' => 'Kakapo Custom sidebar', 'slug' => 'kakapo', 'source' => get_template_directory() . '/inc/plugins/kakapo.zip', 'required' => true, 'version' => '', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Social Count Plus', 'slug' => 'social-count-plus', 'source' => get_template_directory() . '/inc/plugins/social-count-plus.zip', 'required' => false, 'version' => '', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'WP Review', 'slug' => 'wp-review', 'source' => get_template_directory() . '/inc/plugins/wp-review.zip', 'required' => false, 'version' => '', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Slider Revolution', 'slug' => 'revslider', 'source' => get_template_directory() . '/inc/plugins/revslider.zip', 'required' => false, 'version' => '', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Layer Slider', 'slug' => 'LayerSlider', 'source' => get_template_directory() . '/inc/plugins/layerslider.zip', 'required' => false, 'version' => '', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Visual Composer', 'slug' => 'js_composer', 'source' => get_template_directory() . '/inc/plugins/js_composer.zip', 'required' => true, 'version' => '3.7.4', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Envato Wordpress Toolkit', 'slug' => 'envato-wordpress-toolkit', 'source' => get_template_directory() . '/inc/plugins/envato-wordpress-toolkit.zip', 'required' => false, 'version' => '', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''));
    // Change this to your theme text domain, used for internationalising strings
    $theme_text_domain = WEBNUS_TEXT_DOMAIN;
    /**
     * Array of configuration settings. Amend each line as needed.
     * If you want the default strings to be available under your own theme domain,
     * leave the strings uncommented.
     * Some of the strings are added into a sprintf, so see the comments at the
     * end of each line for what each argument will be.
     */
    $config = array('domain' => WEBNUS_TEXT_DOMAIN, 'default_path' => '', 'parent_menu_slug' => 'themes.php', 'parent_url_slug' => 'themes.php', 'menu' => 'install-required-plugins', 'has_notices' => true, 'is_automatic' => false, 'message' => '', 'strings' => array('page_title' => __('Install Required Plugins', $theme_text_domain), 'menu_title' => __('Install Plugins', $theme_text_domain), 'installing' => __('Installing Plugin: %s', $theme_text_domain), 'oops' => __('Something went wrong with the plugin API.', $theme_text_domain), 'notice_can_install_required' => _n_noop('This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.'), 'notice_can_install_recommended' => _n_noop('This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.'), 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.'), 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.'), 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.'), 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.'), 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.'), 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.'), 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins'), 'activate_link' => _n_noop('Activate installed plugin', 'Activate installed plugins'), 'return' => __('Return to Required Plugins Installer', $theme_text_domain), 'plugin_activated' => __('Plugin activated successfully.', $theme_text_domain), 'complete' => __('All plugins installed and activated successfully. %s', $theme_text_domain), 'nag_type' => 'updated'));
    tgmpa($plugins, $config);
}
if (function_exists('vc_set_as_theme')) {
    vc_set_as_theme();
}
开发者ID:bhuvanaurora,项目名称:wordpress-wed,代码行数:31,代码来源:init.php


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