Skip to content

Snippet: Whitelist Conditional Logic Functions

The theme includes a class named TotalTheme\Conditional_Logic that is used for certain functions such as the Transparent Header Conditional Logic customizer field. This class will loop through your defined parameters to check if any return true. For security reasons only whitelisted functions can be used so if you want to use any functions that aren't currently whitelisted you will need to whitelist them like such:

/**
 * Whitelist your custom conditional functions.
 *
 * @link https://total.wpexplorer.com/docs/snippets/conditional-logic-whitelist/
 */
add_filter( 'wpex_conditional_logic_whitelist', function( $whitelist ) {
	$whitelist[] = 'your_custom_function_name';
	return $whitelist;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top