Make WordPress Core


Ignore:
Timestamp:
09/20/2023 07:29:30 PM (5 months ago)
Author:
joedolson
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r56480 r56637  
    10681068            'metadata'         => wp_get_attachment_metadata( $media_item->ID ),
    10691069            'type'             => $media_item->post_mime_type,
     1070            'alt'              => get_post_meta( $media_item->ID, '_wp_attachment_image_alt', true ),
    10701071        );
    10711072
Note: See TracChangeset for help on using the changeset viewer.