首页 WordPress函数大全 get_preview_post_link()

get_preview_post_link()

2020-05-01 / 2095阅 / 悠然

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

get_preview_post_link( int|WP_Post $post = null, array $query_args = array(), string $preview_link = '' )

Retrieves the URL used for the post preview.

描述

Allows additional query args to be appended.

参数

$post

(int|WP_Post)
(Optional)
Post ID or WP_Post object. Defaults to global $post.

Default value: null

$query_args

(array)
(Optional)
Array of additional query args to be appended to the link.

Default value: array()

$preview_link

(string)
(Optional)
Base preview link to be used if it should differ from the post permalink.

Default value: ''

返回

(string|null) URL used for the post preview, or null if the post does not exist.

大家谈论
    我的见解