Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators
Controller::get_stats_parts
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.
Returns
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() Controller::get stats parts code WC 11.0.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(
$endpoint,
$stat,
);
}