get_lastpostmodified

Filters the date the last post was modified.

Description

apply_filters( 'get_lastpostmodified', (string) $lastpostmodified, (string) $timezone ); 

Parameters (2)

0. $lastpostmodified (string)
Date the last post was modified.
1. $timezone (string)
Location to use for getting the post modified date. See get_lastpostdate() for accepted $timezone values.

Usage

To run the hook, copy the example below.
  1. $lastpostmodified = apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); 
  2.  
  3. if ( !empty( $lastpostmodified ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the get_lastpostmodified callback 
  2. function filter_get_lastpostmodified( $lastpostmodified, $timezone ) { 
  3. // make filter magic happen here... 
  4. return $lastpostmodified
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'get_lastpostmodified', 'filter_get_lastpostmodified', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'get_lastpostmodified', 'filter_get_lastpostmodified', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/post.php  
  1. return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );