Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators

Controller::get_stats_parts()privateWC 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.

Method of the class: Controller{}

No Hooks.

Return

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

Usage

// 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.

Controller::get_stats_parts() code WC 9.3.3

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(
		$endpoint,
		$stat,
	);
}