Make WordPress Core


Ignore:
Timestamp:
09/12/2018 11:55:47 PM (6 years ago)
Author:
kadamwhite
Message:

REST API: Pass correct ID to meta->update_value to permit setting term meta during term creation.

Props joehoyle.
Fixes #44834.

File:
1 edited

Legend:

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

    r43571 r43636  
    455455        $schema = $this->get_item_schema();
    456456        if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {
    457             $meta_update = $this->meta->update_value( $request['meta'], (int) $request['id'] );
     457            $meta_update = $this->meta->update_value( $request['meta'], $term->term_id );
    458458
    459459            if ( is_wp_error( $meta_update ) ) {
Note: See TracChangeset for help on using the changeset viewer.