Make WordPress Core


Ignore:
Timestamp:
11/08/2016 01:08:49 PM (8 years ago)
Author:
joehoyle
Message:

REST API: Remove rest_get_post filter and get_post abstraction.

This filter was originally introduced in https://github.com/WP-API/WP-API/pull/2535 to support Customizer Changesets (née Transactions). This is a super broad filter and doesn't really fit with the design of the API, nor is it (arguably) the right level to do this.

Props rmccue.
Fixes #38701.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    r39155 r39161  
    7373        // Attaching media to a post requires ability to edit said post.
    7474        if ( ! empty( $request['post'] ) ) {
    75             $parent = $this->get_post( (int) $request['post'] );
     75            $parent = get_post( (int) $request['post'] );
    7676            $post_parent_type = get_post_type_object( $parent->post_type );
    7777
     
    154154        }
    155155
    156         $attachment = $this->get_post( $id );
     156        $attachment = get_post( $id );
    157157
    158158        // Include admin functions to get access to wp_generate_attachment_metadata().
     
    218218        }
    219219
    220         $attachment = $this->get_post( $request['id'] );
     220        $attachment = get_post( $request['id'] );
    221221
    222222        $fields_update = $this->update_additional_fields_for_object( $attachment, $request );
Note: See TracChangeset for help on using the changeset viewer.