Overview
The ctdqb_main_html_output filter hook allows you to modify the main HTML output of the module.
Hook Parameters
- $html_output: The original HTML content of the module.
- $module_props: An array containing module-specific properties.
- $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