WC_REST_System_Status_V2_Controller::get_post_type_counts()
Get array of counts of objects. Orders, products, etc.
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();
WC_REST_System_Status_V2_Controller::get_post_type_counts() WC REST System Status V2 Controller::get post type counts code WC 7.7.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(); }