首页 WordPress函数大全 get_post_permalink()

get_post_permalink()

2020-05-01 / 4304阅 / 悠然

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

get_post_permalink( int|WP_Post $id, bool $leavename = false, bool $sample = false )

Retrieves the permalink for a post of a custom post type.

描述

参数

$id

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

$leavename

(bool)
(Optional)
defaults to false. Whether to keep post name.

Default value: false

$sample

(bool)
(Optional)
defaults to false. Is it a sample permalink.

Default value: false

返回

(string|WP_Error) The post permalink.

大家谈论
    我的见解