XML-RPC: Add `alt` attribute value to media item API.
Add alt text to the `wp.getMediaItem` method in the XML-RPC API. Allows users to fetch alt text as a first-class member of a media object. Props thomashorta, joedolson, jivygraphics, stephenerdelyi, mukesh27, whyisjake. Fixes #58582. Built from https://develop.svn.wordpress.org/trunk@56637 git-svn-id: http://core.svn.wordpress.org/trunk@56149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
453fb650d6
commit
ebfa9be225
|
@ -1067,6 +1067,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
'description' => $media_item->post_content,
|
'description' => $media_item->post_content,
|
||||||
'metadata' => wp_get_attachment_metadata( $media_item->ID ),
|
'metadata' => wp_get_attachment_metadata( $media_item->ID ),
|
||||||
'type' => $media_item->post_mime_type,
|
'type' => $media_item->post_mime_type,
|
||||||
|
'alt' => get_post_meta( $media_item->ID, '_wp_attachment_image_alt', true ),
|
||||||
);
|
);
|
||||||
|
|
||||||
$thumbnail_src = image_downsize( $media_item->ID, $thumbnail_size );
|
$thumbnail_src = image_downsize( $media_item->ID, $thumbnail_size );
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.4-alpha-56636';
|
$wp_version = '6.4-alpha-56637';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue