woocommerce_product_feed_time
Allows the current time to be overridden before a feed is stored.
Usage
add_filter( 'woocommerce_product_feed_time', 'wp_kama_woocommerce_product_feed_time_filter', 10, 2 );
/**
* Function for `woocommerce_product_feed_time` filter-hook.
*
* @param int $time The current time.
* @param FeedInterface $feed The feed instance.
*
* @return int
*/
function wp_kama_woocommerce_product_feed_time_filter( $time, $feed ){
// filter...
return $time;
}
- $time(int)
- The current time.
- $feed(FeedInterface)
- The feed instance.
Changelog
| Since 10.5.0 | Introduced. |
Where the hook is called
woocommerce_product_feed_time
woocommerce/src/Internal/ProductFeed/Storage/JsonFileFeed.php 109
$current_time = apply_filters( 'woocommerce_product_feed_time', time(), $this );