Skip to content

Instantly share code, notes, and snippets.

@gemmadlou
Forked from TheZoker/custom_vc_element.php
Created January 28, 2016 18:58
Show Gist options
  • Save gemmadlou/45c6b19904fe8fe41cbf to your computer and use it in GitHub Desktop.
Save gemmadlou/45c6b19904fe8fe41cbf to your computer and use it in GitHub Desktop.
<?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