Make WordPress Core

Ticket #39805: 39805.1.diff

File 39805.1.diff, 710 bytes (added by kadamwhite, 9 years ago)

A simple patch permitting featured_media to display in "embed" context

  • src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
    index 25e9c9a..583f732 100644
    class WP_REST_Posts_Controller extends WP_REST_Controller { 
    19411941                                        $schema['properties']['featured_media'] = array(
    19421942                                                'description' => __( 'The ID of the featured media for the object.' ),
    19431943                                                'type'        => 'integer',
    1944                                                 'context'     => array( 'view', 'edit' ),
     1944                                                'context'     => array( 'view', 'edit', 'embed' ),
    19451945                                        );
    19461946                                        break;
    19471947