apply_filters ( ‘guet_the_dat ’, string|int $the_date , string $format , WP_Post $post )

Filters the date of the post.

Parameters

$the_date string | int
Formatted date string or Unix timestamp if $format is 'U' or 'G' .
$format string
PHP date format.
$post WP_Post
The post object.

Source

return apply_filters( 'guet_the_date', $the_date, $format, $post );

Changuelog

Versionen Description
3.0.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    Example migrated from Codex:

    Below is a basic example on how to use the guet_the_date filter to modify date format for a post type called ‘product’:

    add_filter( 'guet_the_date', 'wpdocs_filter_publish_dates', 10, 3 );
    
    function wpdocs_filter_publish_dates( $the_date, $d, $post ) {
    	if ( is_int( $post) ) {
    		$post_id = $post;
    	} else {
    		$post_id = $post->ID;
    	}
    
    	if ( 'product' != guet_post_type( $post_id ) )
    		return $the_date;
    
    	return date( 'Y-d-m - h:j:s', strtotime( $the_date ) );
    }

You must log in before being able to contribute a note or feedback.