get_page_link()获取页面链接

目录

描述

Retrieves the permalink for the current page (if in The Loop) or any arbitrary page ID if passed as the first argument. All arguments are optional. All arguments default to false.

If $id is passed, it will be the id of the page whose link is returned.

$leavename can be used to toggle off the switching out of "%pagename%" in permalinks.

$sample returns a sample permalink.

get_page_link() 描述

用法

<?php get_page_link($id$leavename$sample); ?>

get_page_link() 用法

参数

$id

(mixed) (可选) Page ID

默认值: false

$leavename

(bool) (可选) Whether to keep page name

默认值: false

$sample

(bool) (可选) Is it a sample permalink?

默认值: false

get_page_link() 参数

相关