Skip to main content

wpb_toggle_heading

Filters the heading HTML output of the Toggle (FAQ) element. This allows modifying the toggle heading markup before it is rendered.

Parameters

ParameterTypeDescription
$heading_outputstringThe HTML output for the toggle heading.
$argsarrayAn associative array with title (the toggle title string) and open (whether the toggle is open by default).

Usage

<?php
add_filter( 'wpb_toggle_heading', 'my_custom_toggle_heading', 10, 2 );

function my_custom_toggle_heading( $heading_output, $args ) {
// Add an icon before the toggle title
$heading_output = '<span class="toggle-icon"></span>' . $heading_output;
return $heading_output;
}

Source

File: include/templates/shortcodes/vc_toggle.php