WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp prepare attachment for js

Description

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

Usage

 <?php wp_prepare_attachment_for_js$attachment ?> 

Parameters

$attachment
(mixed) (required) Attachment ID or object.
Default: None

Return Value

(array) 
Array of attachment details.

Examples

Default Usage

Change Log

Source File

wp_prepare_attachment_for_js() is located in wp-includes/media.php.

Related