Automattic\WooCommerce\Internal\Logging

OrderLogsDeletionProcessor::get_total_pending_count_cptprivateWC 1.0

Get the total count of entries pending processing, CPT datastore version.

Method of the class: OrderLogsDeletionProcessor{}

No Hooks.

Returns

Int.

Usage

// private - for code of main (parent) class only
$result = $this->get_total_pending_count_cpt(): int;

OrderLogsDeletionProcessor::get_total_pending_count_cpt() code WC 10.8.1

private function get_total_pending_count_cpt(): int {
	global $wpdb;

	return (int) $wpdb->get_var(
		$wpdb->prepare(
			"SELECT COUNT(*)
                 FROM {$wpdb->postmeta} pm
                 INNER JOIN {$wpdb->posts} p ON pm.post_id = p.ID
                 WHERE pm.meta_key = %s
                 AND p.post_type = %s",
			'_debug_log_source_pending_deletion',
			'shop_order'
		)
	);
}