wppaste
WordPress

apply_filters( 'pre_get_lastpostmodified', string|false $lastpostmodified, string $timezone, string $post_type )

Since
4.4.0
Pre-filter the return value of get_lastpostmodified() before the query is run.

Compatibility

WordPress
since 4.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$lastpostmodifiedstring|false
The most recent time that a post was modified, in 'Y-m-d H:i:s' format, or false. Returning anything other than false will short-circuit the function.
$timezonestring
Location to use for getting the post modified date.
See get_lastpostdate() for accepted $timezone values.
$post_typestring
The post type to check.

Where this hook fires · 1

  • wp-includes/post.php:7590get_lastpostmodified()

Source code

	 *                                       in 'Y-m-d H:i:s' format, or false. Returning anything	 *                                       other than false will short-circuit the function.	 * @param string       $timezone         Location to use for getting the post modified date.	 *                                       See get_lastpostdate() for accepted `$timezone` values.	 * @param string       $post_type        The post type to check.	 */	$lastpostmodified = apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type ); 	if ( false !== $lastpostmodified ) {		return $lastpostmodified;	} 	$lastpostmodified = _get_last_post_time( $timezone, 'modified', $post_type );

Changelog

Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.