Switch language

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




get_post_time [ WordPress Function ]

get_post_time ( $d = 'U', $gmt = false, $post = null, $translate = false )
Parameters:
  • (string) $d Optional Either 'G', 'U', or php date format.
  • (bool) $gmt Optional, default is false. Whether to return the gmt time.
  • (int|object) $post Optional post ID or object. Default is global $post object.
  • (bool) $translate Whether to translate the time string
Returns:
  • (string)
Defined at:



Retrieve the time at which the post was written.

Source


<?php
function get_post_time$d 'U'$gmt false$post null$translate false ) { // returns timestamp
    
$post get_post($post);

    if ( 
$gmt )
        
$time $post->post_date_gmt;
    else
        
$time $post->post_date;

    
$time mysql2date($d$time$translate);
    return 
apply_filters('get_post_time'$time$d$gmt);
}
?>

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