get_post_time

過濾鉤子
apply_filters( 'get_post_time', $time, $format, $gmt )
引數
  • (string|int) $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
    Required:
  • (string) $format Format to use for retrieving the time the post was written. Accepts 'G', 'U', or PHP date format.
    Required:
  • (bool) $gmt Whether to retrieve the GMT time.
    Required:
定義位置
相關勾子
get_the_timeget_comment_timeget_post_modified_timesingle_post_titleget_site
相關方法
get_post_timeget_post_datetimeget_post_typeget_post_metaget_post_timestamp_get_last_post_time
引入
2.6.0
棄用
-

get_post_time是一個WordPress函式,用於檢索一個文章釋出的日期和時間: 該函式接受一個格式引數,並以指定的格式返回釋出時間。

過濾一個文章的本地化時間。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'get_post_time', $time, $format, $gmt );
return apply_filters( 'get_post_time', $time, $format, $gmt );
return apply_filters( 'get_post_time', $time, $format, $gmt );

常見問題

FAQs
檢視更多 >