post_permalink

函式
post_permalink ( $post = 0 )
引數
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global $post.
    Required:
返回值
  • (string|false)
相關
  • get_permalink()
定義位置
相關方法
get_post_permalinkthe_permalinkget_permalink_post_format_linkget_post_format_link
引入
1.0.0
棄用
4.4.0

post_permalink is a WordPress function that generates the permalink for a post. 它接受一個引數,$post_id(文章的ID),並以字串形式返回固定連結。

從文章ID中檢索固定連結。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function post_permalink( $post = 0 ) {
_deprecated_function( __FUNCTION__, '4.4.0', 'get_permalink()' );
return get_permalink( $post );
}
function post_permalink( $post = 0 ) { _deprecated_function( __FUNCTION__, '4.4.0', 'get_permalink()' ); return get_permalink( $post ); }
function post_permalink( $post = 0 ) {
	_deprecated_function( __FUNCTION__, '4.4.0', 'get_permalink()' );

	return get_permalink( $post );
}

常見問題

FAQs
檢視更多 >