WC_REST_System_Status_V2_Controller::get_post_type_counts() public WC 1.0
Get array of counts of objects. Orders, products, etc.
{} It's a method of the class: WC_REST_System_Status_V2_Controller{}
No Hooks.
Return
Array.
Usage
$WC_REST_System_Status_V2_Controller = new WC_REST_System_Status_V2_Controller(); $WC_REST_System_Status_V2_Controller->get_post_type_counts();
Code of WC_REST_System_Status_V2_Controller::get_post_type_counts() WC REST System Status V2 Controller::get post type counts WC 5.0.0
public function get_post_type_counts() {
global $wpdb;
$post_type_counts = $wpdb->get_results( "SELECT post_type AS 'type', count(1) AS 'count' FROM {$wpdb->posts} GROUP BY post_type;" );
return is_array( $post_type_counts ) ? $post_type_counts : array();
}