get_preview_post_link()
get_preview_post_link( int|WP_Post $post = null, array $query_args = array(), string $preview_link = ” )
检索用于发布预览的URL。
Retrieves the URL used for the post preview.
说明(Description)
允许附加其他查询参数。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post | (int | WP_Post) | 可选 | Post ID或WP_Post对象。默认为全局$post。 |
$query_args | (array) | 可选 | 要附加到链接的附加查询参数数组。 |
$preview_link | (string) | 可选 | 如果与post permalink不同,则使用基本预览链接。 |
返回(Return)
(string|null)用于文章预览的URL,如果文章不存在,则为空。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.4.0 | wp-includes/link-template.php:1318 | 9 | 8 |
get_preview_post_link() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_preview_post_link/