首页 WordPress函数大全 get_attachment_link()

get_attachment_link()

2020-05-01 / 4553阅 / 悠然

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

get_attachment_link( int|object $post = null, bool $leavename = false )

Retrieves the permalink for an attachment.

描述

This can be used in the WordPress Loop or outside of it.

参数

$post

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

Default value: null

$leavename

(bool)
(Optional)
Whether to keep the page name.

Default value: false

返回

(string) The attachment permalink.

大家谈论
    我的见解