Add Condition if WPBakery Page Builder Used on Page or Not
I'm using WPBakery Page Builder for a new site I'm developing, and I need to add a condition for if WPBakery Page Builder is used for a page or not. I looked through the API documentation, and all I found was a check for if frontend editing is enabled or not:
https://kb.wpbakery.com/docs/inner-api/vc_enabled_frontend/
<?php
if ( vc_enabled_frontend() ) {
// Front end editor mode is enabled. Do something.
}
?>
This solution is not what I'm looking for. Does anyone know how to check if the plugin is used to build a page or not?
Solutions
Some quick answer you can achieve what you want to do. There is a filter which check if the current page
post type
is available for using WPBaker called `vc_is_valid_post_type_be' and there you can manage "can" or "cannot" to load it.
add_filter('vc_is_valid_post_type_be', 'wpse308043_vc_is_valid_post_type_be', 10, 2);
function wpse308043_vc_is_valid_post_type_be($checked_type, $type) {
global $post;
if($post->ID == 106)
return false;
return $checked_type;
}
Similar questions
deactivate WPBakery Page Builder license
I need to deactivate the license and reinstall it ... will it be such that my content that I wrote and those blocks that I set to be deleted and not appear again with the new license?
dokan plugin conflict with wpbakery page builder (Visual Composer)
in my WordPress website i found that wpbakery page builder doesn't work correctly while Dokan plugin is enabled. for example when we add a text block, the editor is not loaded and sometime text block is not loaded at all. when we disable Dokan plugin, it works good. is it possible to correct such inconsistencies by altering any configuration files ...
WPBakery Page Builder get custom css from design options
I have a page with a theme that integrates WPBakery Page Builder. The theme creates a single page layout by adding together different pages. The single pages itself have some custom design options, e.g. row paddings, margins, background-image, etc. If I open one page alone, I can see the custom css applied. But in the one-page-layout, those custom ...
How to enable Wpbakery Page Builder(Visual Composer) in CMB2 "wysiwyg" type?
I am adding a custom metabox text editor in wordpress with CMB2 for post type. Here Wpbakery Page Builder(Visual Composer) is enabled in default post type editor. but i can't able to enable Wpbakery Page Builder(Visual Composer) in custom post editor which i have implemented with CMB2 metabox. It has been implemented with "wysiwyg" type. Is there a...
WPBakery Page Builder - Checkboxes won't retain values from v6.xx
For the last few years I have been developing a custom theme and various plugins that add options to WPBakery Page Builder elements and create new custom elements, etc. Everything has worked perfectly up to Page Builder v5.7. But then when v6.0.x came out, suddenly every Checkbox option I have added to every element, be it a custom element or one o...
Also ask