Make WordPress Core


Ignore:
Timestamp:
10/11/2018 06:34:34 AM (8 years ago)
Author:
SergeyBiryukov
Message:

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

Props joehoyle.
Merges [43636] to the 5.0 branch.
Fixes #44834.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

    r43445 r43714  
    442442                $schema = $this->get_item_schema();
    443443                if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {
    444                         $meta_update = $this->meta->update_value( $request['meta'], (int) $request['id'] );
     444                        $meta_update = $this->meta->update_value( $request['meta'], $term->term_id );
    445445
    446446                        if ( is_wp_error( $meta_update ) ) {
Note: See TracChangeset for help on using the changeset viewer.