is_attachment()判断当前页面是否为一个附件页面“图片或文件”。

目录

描述

This Conditional Tag checks if an attachment is being displayed. An attachment is an image or other file uploaded through the post editor's upload utility. Attachments can be displayed on their own 'page' or template. For more information, see Using Image and File Attachments.

This is a boolean function, meaning it returns either TRUE or FALSE.

is_attachment() 描述

用法

<?php is_attachment(); ?>

is_attachment() 用法

返回值

(boolean

True on success, false on failure.

is_attachment() 返回值

示例

is_attachment() 示例

注意

is_attachment() 注意

历史

添加于 版本: 2.0.0

is_attachment() 历史

源文件

is_attachment() 函数的代码位于 wp-includes/query.php.

is_attachment() 源文件

相关