Automattic\WooCommerce\StoreApi\Utilities

ProductQuery::get_last_modified()publicWC 1.0

Get last modified date for all products.

Method of the class: ProductQuery{}

No Hooks.

Return

Int. timestamp.

Usage

$ProductQuery = new ProductQuery();
$ProductQuery->get_last_modified();

ProductQuery::get_last_modified() code WC 8.6.1

public function get_last_modified() {
	global $wpdb;

	return strtotime( $wpdb->get_var( "SELECT MAX( post_modified_gmt ) FROM {$wpdb->posts} WHERE post_type IN ( 'product', 'product_variation' );" ) );
}