-
-
Save gemmadlou/45c6b19904fe8fe41cbf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function free_and_premium() { | |
vc_map( array( | |
"name" => __("Premium", "js_composer"), | |
"base" => "premium", | |
"content_element" => true, | |
"category" => "content>", | |
"show_settings_on_create" => false, | |
"params" => array( | |
// add params same as with any other content element | |
array( | |
"type" => "textfield", | |
"heading" => __("Extra class name", "js_composer"), | |
"param_name" => "el_class", | |
"description" => __("Content only visible for premium members.", "js_composer") | |
) | |
), | |
"js_view" => 'VcColumnView' | |
) ); | |
vc_map( array( | |
"name" => __("Free", "js_composer"), | |
"base" => "free", | |
"content_element" => true, | |
"show_settings_on_create" => false, | |
"params" => array( | |
// add params same as with any other content element | |
array( | |
"type" => "textfield", | |
"heading" => __("Extra class name", "js_composer"), | |
"param_name" => "el_class", | |
"description" => __("Content only visible for free members.", "js_composer") | |
) | |
), | |
"js_view" => 'VcColumnView' | |
) ); | |
if ( class_exists( 'WPBakeryShortCodesContainer' ) ) { | |
class WPBakeryShortCode_Premium extends WPBakeryShortCodesContainer { | |
} | |
} | |
if ( class_exists( 'WPBakeryShortCodesContainer' ) ) { | |
class WPBakeryShortCode_Free extends WPBakeryShortCodesContainer { | |
} | |
} | |
} | |
add_action( 'vc_before_init', 'free_and_premium' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment