Skip to main content

vc_templates_render_template

Filters the HTML output of a single template item within a template category list in the templates panel.

Parameters

ParameterTypeDescription
$namestringThe template name used for display.
$templatearrayThe template data array containing template details.

Usage

<?php
add_filter( 'vc_templates_render_template', 'my_render_template_item', 10, 2 );

function my_render_template_item( $name, $template ) {
// Add a custom badge next to the template name.
return '<span class="vc_ui-template-title">' . esc_html( $name ) . '</span>'
. '<span class="my-badge">New</span>';
}

Source

File: include/classes/editors/popups/class-vc-templates-panel-editor.php