WordPress at Your Fingertips
function is not described


Controller::get_stats_parts() private WC 1.0

Returns the endpoint part of a stat request (prefix) and the actual stat total we want. To allow extensions to namespace (example: fue/emails/sent), we break on the last forward slash.

{} It's a method of the class: Controller{}

No Hooks.


Array. Containing the prefix (endpoint) and suffix (stat).


// private - for code of main (parent) class only
$result = $this->get_stats_parts( $full_stat );
$full_stat(string) (required)
A stat request string like orders/avg_order_value or fue/emails/sent.

Code of Controller::get_stats_parts() WC 6.1.1

private function get_stats_parts( $full_stat ) {
	$endpoint = substr( $full_stat, 0, strrpos( $full_stat, '/' ) );
	$stat     = substr( $full_stat, ( strrpos( $full_stat, '/' ) + 1 ) );
	return array(