get_the_date
is a filter applied to posts publish dates.
Below is a basic example on how to use the get_the_date
filter to modify date format for a post type called 'product':
function my_project_filter_publish_dates( $the_date, $d, $post ) { if ( is_int( $post) ) { $post_id = $post; } else { $post_id = $post->ID; } if ( 'product' != get_post_type( $post_id ) ) return $the_date; return date( 'Y-d-m - h:j:s', strtotime( $the_date ) ); } add_action( 'get_the_date', 'my_project_filter_publish_dates', 10, 3 );
Applied in get_the_date in wp-includes/general-template.php