描述:
获取页面链接
用法:
<?php get_page_link($id, $leavename, $sample); ?>
参数:
$id
(mixed) (可选) 页面ID
默认值: false
$leavename
(bool) (可选) 是否保留页面名称
默认值: false
$sample
(bool) (可选) Is it a sample permalink?
默认值: false
源文件:
<?php
...
function is_attachment( $attachment = '' ) {
global $wp_query;
if ( ! isset( $wp_query ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
return false;
}
return $wp_query->is_attachment( $attachment );
}
...
?>