Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!defined('ABSPATH')) die('-1');
- add_filter( 'vc_load_default_templates', 'my_custom_template_modify_array' ); // Hook in
- function my_custom_template_modify_array( $data ) {
- return array(); // This will remove all default templates. Basically you should use native PHP functions to modify existing array and then return it.
- }
- function seo_vc_homepage() {
- $data = array(); // Create new array
- $data['name'] = __( 'Seo Homepage', 'seo' ); // Assign name for your custom template
- $data['weight'] = 0; // Weight of your template in the template list
- $data['image_path'] = preg_replace( '/\s/', '%20', plugins_url( 'images/custom_template_thumbnail.jpg', __FILE__ ) );
- $data['content'] = <<<CONTENT
- /* here is shortcode */
- CONTENT;
- vc_add_default_templates( $data );
- }
- add_action( 'vc_load_default_templates_action','seo_vc_homepage' ); // Hook in
Advertisement
Add Comment
Please, Sign In to add comment