1. Home
  2. Docs
  3. Divi Query Builder
  4. Action & Filter Hook...
  5. Main HTML Output

Main HTML Output

Overview

The ctdqb_main_html_output  filter hook allows you to modify the main HTML output of the module.

Hook Parameters

  1. $html_output: The original HTML content of the module.
  2. $module_props: An array containing module-specific properties.
  3. $query_data: An array containing query results.

https://gist.github.com/divicoding-dev/185797c6e68784300bdd2482510845a1

function ctdqb_main_html_output_callback( $html_output, $query_data, $module_props ) {
	// Use the admin label if you need to apply the filter only to a specific module
	if ( isset( $module_props['admin_label'] ) && $module_props['admin_label'] === 'query_all_events' && empty( $query_data['data'] ) ) {
		$html_output = 'No events found'; 
} 
return $html_output; } 
add_filter( 'ctdqb_main_html_output', 'ctdqb_main_html_output_callback', 10, 3 );

0 Comments

Submit a Comment

How can we help?