Home / Admin / Charitable Reporting: Adjusting Initial Filters
Duplicate Snippet

Embed Snippet on Your Site

Charitable Reporting: Adjusting Initial Filters

Changes the default reporting filters for the overview report page in the admin.

Code Preview
php
<?php
add_filter( 'charitable_report_overview_args', 'example_charitable_report_overview_defaults', 999 );
function example_charitable_report_overview_defaults( $defaults = array() ) {
	// Defaults array contains:
	// start_date, end_date, filter, campaign_id, category_id.
	// The $defaults array contains the default values for the report overview.
	// You can modify these as needed.
	// For example, you could change the default start date to be always the first of the current year.
	$defaults['start_date'] = date( 'Y/01/01' );
	// Or you could change the default end date to be today.
	$defaults['end_date'] = date( 'Y/m/d' );
	return $defaults;
}

Comments

Add a Comment