wp_prepare_attachment_for_js()获取一个附件(图片/文件)的JSON序列信息

目录

描述

Prepares an attachment post object for JS, where it is expected to be JSON-encoded and fit into an Attachment model.

wp_prepare_attachment_for_js() 描述

用法

 <?php wp_prepare_attachment_for_js$attachment ?> 

wp_prepare_attachment_for_js() 用法

参数

$attachment

(mixed) (必填) Attachment ID or object.

默认值: None

wp_prepare_attachment_for_js() 参数

示例

Pass image data to a js gallery.

Default Usage

wp_prepare_attachment_for_js() 示例

历史

  • 添加于 版本: 3.5.0

wp_prepare_attachment_for_js() 历史

源文件

wp_prepare_attachment_for_js() 函数的代码位于 wp-includes/media.php.

wp_prepare_attachment_for_js() 源文件