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.
Built from https://develop.svn.wordpress.org/branches/5.0@43714


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-10-11 06:35:23 +00:00
parent b9fb2a42b1
commit c288d39db2
2 changed files with 2 additions and 2 deletions

View File

@ -441,7 +441,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
$schema = $this->get_item_schema(); $schema = $this->get_item_schema();
if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {
$meta_update = $this->meta->update_value( $request['meta'], (int) $request['id'] ); $meta_update = $this->meta->update_value( $request['meta'], $term->term_id );
if ( is_wp_error( $meta_update ) ) { if ( is_wp_error( $meta_update ) ) {
return $meta_update; return $meta_update;

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-43713'; $wp_version = '5.0-alpha-43714';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.