Filter
rpress_reports_tab_files
On this page
Filters the list of PHP files that provide the reports tabs.
Runs once, when the reports file is loaded during the admin bootstrap, not when the reports screen is displayed. Keys are tab IDs and values are absolute file paths; every readable file in the array is then included. Register the filter early, for example from a must-use plugin or a plugin that loads before RestroPress.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$tab_files | array | Array of tab ID => absolute path of the PHP file defining that tab. |
Return value#
array. The tab ID => file path array.
Example#
function my_report_tab_files( $tab_files ) {
$tab_files['loyalty'] = plugin_dir_path( __FILE__ ) . 'reports/loyalty.php';
return $tab_files;
}
add_filter( 'rpress_reports_tab_files', 'my_report_tab_files', 10, 1 );
Notes#
The default tabs are overview, sales, orders-risk, menu, customers, payments-recovery, taxes and export. A new tab still has to be added to the list with rpress_reports_intelligence_tabs.
Source#
Applied in:
includes/admin/reporting/reports.php(line 17)
See also#
Was this page helpful?
