/** * 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())); }
function mango_vcSetAsTheme() { // Set Visual Composer if (function_exists('vc_set_as_theme')) { vc_set_as_theme(); } }
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); }
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(); } }
/** * 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(); }
/** * 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); }
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')); } }
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); }
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'); } }
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(); }
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(); }
/** * 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')); } }
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'); } }
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); }
* 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(); }
:: TGM PLUGIN ACTIVATION ------------------------------------ */ require_once NV_FILES . '/adm/inc/class-tgm-plugin-activation.php'; add_action('tgmpa_register', 'themeva_register_required_plugins'); function themeva_register_required_plugins() { /** * Array of plugin arrays. Required keys are name, slug and required. * If the source is NOT from the .org repo, then source is also required. */ $plugins = array(array('name' => 'Visual Composer', 'slug' => 'js_composer', 'source' => get_stylesheet_directory() . '/plugins/js_composer.zip', 'required' => true, 'version' => '4.5.3', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '')); $config = array('domain' => 'themeva', 'default_path' => '', 'parent_menu_slug' => 'themes.php', 'parent_url_slug' => 'themes.php', 'menu' => 'install-required-plugins', 'has_notices' => true, 'is_automatic' => true, 'message' => '', 'strings' => array('page_title' => __('Install Required Plugins', 'themeva-admin'), 'menu_title' => __('Install Plugins', 'themeva-admin'), 'installing' => __('Installing Plugin: %s', 'themeva-admin'), 'oops' => __('Something went wrong with the plugin API.', 'themeva-admin'), 'notice_can_install_required' => _n_noop('This theme requires the following plugin:<span class="highlight-admin-text">%1$s</span>.', 'This theme requires the following plugins: <span class="highlight-admin-text">%1$s</span>.'), 'notice_can_install_recommended' => _n_noop('This theme recommends the following plugin:<span class="highlight-admin-text">%1$s</span>.', 'This theme recommends the following plugins: <span class="highlight-admin-text">%1$s</span>.'), '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: <span class="highlight-admin-text">%1$s</span>.', 'The following required plugins are currently inactive: <span class="highlight-admin-text">%1$s</span>.'), 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: <span class="highlight-admin-text">%1$s</span>.', 'The following recommended plugins are currently inactive: <span class="highlight-admin-text">%1$s</span>.'), '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 <span class="highlight-admin-text">needs to be updated</span> to its latest version to ensure maximum compatibility with this theme: <span class="highlight-admin-text">%1$s</span>.<p></p>For a guide on <a href="http://help.themeva.com/theme-issues/" target="_blank">how to upgrade</a> the plugin see this page <a href="http://help.themeva.com/theme-issues/" target="_blank">here</a>.', 'The following plugin <span class="highlight-admin-text">needs to be updated</span> to its latest version to ensure maximum compatibility with this theme: <span class="highlight-admin-text">%1$s</span>.<p></p>For a guide on <a href="http://help.themeva.com/theme-issues/" target="_blank">how to upgrade</a> the plugin see this page <a href="http://help.themeva.com/theme-issues/" target="_blank">here</a>.'), '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', 'themeva-admin'), 'plugin_activated' => __('Plugin activated successfully.', 'themeva-admin'), 'complete' => __('All plugins installed and activated successfully. %s', 'themeva-admin'))); tgmpa($plugins, $config); } if (function_exists('vc_set_as_theme')) { vc_set_as_theme($notifier = false); } // VC Columns function custom_css_classes_for_vc_row_and_vc_column($class_string, $tag) { if ($tag == 'vc_row' || $tag == 'vc_row_inner') { $class_string = str_replace('vc_row-fluid', 'row', $class_string); } if ($tag == 'vc_column' || $tag == 'vc_column_inner') { if (WPB_VC_VERSION >= '4.3') { $class_string = preg_replace('/vc_col-sm-(\\d{1,2})/e', "numberToWords(\$1,'vc')", $class_string); } else { $class_string = preg_replace('/vc_span(\\d{1,2})/e', "numberToWords(\$1,'vc')", $class_string); } } return $class_string;
function Ya_vcSetAsTheme() { vc_set_as_theme(); }
/** * Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page */ function berg_vcSetAsTheme() { vc_set_as_theme(true); vc_set_default_editor_post_types(array('post', 'page', 'berg_menu', 'berg_restaurant', 'berg_portfolio', 'berg_footer')); // print_r(vc_editor_post_types()); }
function sd_vc_as_theme() { vc_set_as_theme(true); }
function web_vcSetAsTheme() { vc_set_as_theme(); }
function mom_vcSetAsTheme() { vc_set_as_theme($disable_updater = true); }
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"; break; case "2/12": $w = "medium-2"; break; case "5/12": $w = "medium-5"; break; case "7/12": $w = "medium-7"; break; default: $w = $width; } return $w; } /* Offsets */ function thb_column_offset_class_merge($column_offset, $width) { /* Remove VC */ $column_offset = preg_replace('/vc_col-/', '', $column_offset); /* Change responsive columns */ $column_offset = preg_replace('/lg/', 'large', $column_offset); $column_offset = preg_replace('/md/', 'medium', $column_offset); $column_offset = preg_replace('/sm/', 'small', $column_offset); $column_offset = preg_replace('/xs/', 'small', $column_offset); /* Check If no Small setting */ if (!preg_match('/vc_col\\-(sm|xs)[^\\s]*/', $column_offset)) { $column_offset = 'small-12 ' . $column_offset; } /* Change visibility */ $column_offset = preg_replace('/vc_hidden-large/', 'hide-for-large-up', $column_offset); $column_offset = preg_replace('/vc_hidden-medium/', 'hide-for-medium-only', $column_offset); $column_offset = preg_replace('/vc_hidden-smallall/', 'hide-for-small-only', $column_offset); return $width . (empty($column_offset) ? '' : ' ' . $column_offset); } }
function wplms_vcSetAsTheme() { vc_set_as_theme(); }
/*------------------------------------------------*/ /* - Dynamic Featured Image custom post /*------------------------------------------------*/ add_filter('dfi_post_types', 'filter_post_types'); function filter_post_types() { return array('post', 'page', 'wt_portfolio'); //will display DFI in post and page } /*------------------------------------------------*/ /* - Visual Composer Tweaks /*------------------------------------------------*/ if (class_exists('WPBakeryVisualComposerAbstract')) { // Set Visual Composer to run in Theme Mode - Remove Visual Composer notifier if (function_exists('vc_set_as_theme')) { vc_set_as_theme(true); } // Override directory where Visual Composer should look for template files for content elements if (function_exists('vc_set_shortcodes_templates_dir')) { $templates_dir = THEME_FUNCTIONS . '/visual-composer/wt_vcsc_templates/'; vc_set_shortcodes_templates_dir($templates_dir); } // Remove certain default VC modules require_once THEME_FUNCTIONS . '/visual-composer/remove.php'; // Make js composer stylesheet to load in onepage themes. add_action('wp_enqueue_scripts', 'force_js_composer_front_load'); function force_js_composer_front_load() { wp_enqueue_style('js_composer_front'); } }
public function __construct() { if (function_exists('vc_set_as_theme')) { vc_set_as_theme(true); } if (function_exists('vc_disable_frontend')) { vc_disable_frontend(); } else { if (class_exists('NewVisualComposer')) { NewVisualComposer::disableInline(); } } add_action('init', array(&$this, 'map'), 20); add_action('init', array(&$this, 'add_params'), 50); if (is_admin()) { add_action('do_meta_boxes', array(&$this, 'remove_vc_teaser_meta_box'), 1); add_action('admin_print_scripts-post.php', array(&$this, 'enqueue_scripts'), 100); add_action('admin_print_scripts-post-new.php', array(&$this, 'enqueue_scripts'), 100); $vc_params_js = DHINC_ASSETS_URL . '/js/vc-params.js'; vc_add_shortcode_param('nullfield', array(&$this, 'nullfield_param'), $vc_params_js); vc_add_shortcode_param('product_attribute_filter', array(&$this, 'product_attribute_filter_param'), $vc_params_js); vc_add_shortcode_param('product_attribute', array(&$this, 'product_attribute_param'), $vc_params_js); vc_add_shortcode_param('products_ajax', array(&$this, 'products_ajax_param'), $vc_params_js); vc_add_shortcode_param('product_brand', array(&$this, 'product_brand_param'), $vc_params_js); vc_add_shortcode_param('product_lookbook', array(&$this, 'product_lookbook_param'), $vc_params_js); vc_add_shortcode_param('product_category', array(&$this, 'product_category_param'), $vc_params_js); vc_add_shortcode_param('ui_datepicker', array(&$this, 'ui_datepicker_param')); vc_add_shortcode_param('post_category', array(&$this, 'post_category_param'), $vc_params_js); vc_add_shortcode_param('ui_slider', array(&$this, 'ui_slider_param')); vc_add_shortcode_param('dropdown_group', array(&$this, 'dropdown_group_param')); } }
} if ($cg_responsive_status == 'disabled') { wp_enqueue_style('cg-non-responsive'); } if (isset($cg_live_preview)) { wp_enqueue_style('cg-livepreviewcss', get_template_directory_uri() . '/css/livepreview.css'); } } add_action('wp_enqueue_scripts', 'load_cg_styles'); // Load css from theme options. require_once CG_CORE . '/css/custom-css.php'; /** * Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page */ if (function_exists('vc_set_as_theme')) { vc_set_as_theme($disable_updater = true); // Disable frontend editor by default - to re-enable just comment out the next line vc_disable_frontend(); } // Initialising Shortcodes if (class_exists('WPBakeryVisualComposerAbstract')) { function requireVcExtend() { require_once locate_template('/customvc/vc_extend.php'); } add_action('init', 'requireVcExtend', 2); // Set VC tpl override directory $vcdir = get_stylesheet_directory() . '/customvc/vc_templates/'; vc_set_template_dir($vcdir); // Remove VC nag looking for key - CommerceGurus has an extended lic. if (is_admin()) {
function your_prefix_vcSetAsTheme() { vc_set_as_theme($disable_updater = true); }
function td_vc_init() { // Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page if (function_exists('vc_set_as_theme')) { vc_set_as_theme(true); } if (function_exists('wpb_map')) { //map all of our blocks in page builder td_global_blocks::wpb_map_all(); } if (function_exists('vc_disable_frontend')) { vc_disable_frontend(); } // @todo - this may not be requiered anynmore if (class_exists('WPBakeryVisualComposer')) { //disable visual composer updater $td_composer = WPBakeryVisualComposer::getInstance(); $td_composer->disableUpdater(); } }
function om_vc_set_as_theme() { vc_set_as_theme(true); }
function mfn_vcSetAsTheme() { vc_set_as_theme(); }