wp_prepare_attachment_for_js

SummerySummery

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

Syntax

wp_prepare_attachment_for_js( int|WP_Post $attachment )

ParametersParameters

$attachment

(int|WP_Post) (Required) Attachment ID or object.

ReturnReturn

(array|void) Array of attachment details.

SourceSource

File: wp-includes/media.php


			

ChangelogChangelog

Changelog
Version Description
3.5.0 Introduced.
Scroll to Top