Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_the_date [ WordPress Function ]

get_the_date ( $d = '' )
Parameters:
  • (string) $d Optional. PHP date format defaults to the date_format option if not specified.
Returns:
  • (string|null) Null if displaying, string if retrieving.
Defined at:



Retrieve the date the current $post was written.

Unlike the_date() this function will always return the date. Modify output with 'get_the_date' filter.

Source


<?php
function get_the_date$d '' ) {
    global 
$post;
    
$the_date '';

    if ( 
'' == $d )
        
$the_date .= mysql2date(get_option('date_format'), $post->post_date);
    else
        
$the_date .= mysql2date($d$post->post_date);

    return 
apply_filters('get_the_date'$the_date$d);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics