首页 WordPress函数大全 get_post_timestamp()

get_post_timestamp()

2020-05-01 / 3810阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_post_timestamp( int|WP_Post $post = null, string $field = 'date' )

Retrieve post published or modified time as a Unix timestamp.

描述

Note that this function returns a true Unix timestamp, not summed with timezone offset like older WP functions.

参数

$post

(int|WP_Post)
(Optional)
WP_Post object or ID. Default is global $post object.

Default value: null

$field

(string)
(Optional)
Published or modified time to use from database. Accepts 'date' or 'modified'.

Default value: 'date'

返回

(int|false) Unix timestamp on success, false on failure.

大家谈论
    我的见解