Filter the list and add reports to the legacy _WooCommerce > Reports_. Array items should be in the format of $reports['automatewoo'] = array( 'title' => 'AutomateWoo', 'reports' => array( 'runs_by_date' => array( 'title' => __( 'Workflow Runs', 'automatewoo' ), 'description' => '', 'hide_title' => false, 'callback' => array( $this, 'get_runs_by_date' ), ), // ... ), ); This filter has a colliding name with the one in Automattic\WooCommerce\Admin\API\Reports\Controller. To make sure your code runs in the context of the legacy _WooCommerce > Reports_ screen, and not the REST endpoint, use the following: add_filter( 'woocommerce_admin_reports', function( $reports ) { if ( is_admin() ) { // ...
$reports
Sortie :
@param array $reports The associative array of reports.
// Modifier la valeur avec le filtre 'woocommerce_reports_charts'
add_filter('woocommerce_reports_charts', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($reports) {
// Modifier la valeur
return $reports;
}
Chargement des actualités...