From 1c7d7b7c15d8e65c6edc7f7d6d4c852ed867230d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 13 Sep 2018 09:53:28 +0000 Subject: [PATCH] REST API: Pass correct ID to `meta->update_value` to permit setting term meta during term creation. Props joehoyle. Merges [43636] to the 4.9 branch. Fixes #44834. Built from https://develop.svn.wordpress.org/branches/4.9@43637 git-svn-id: http://core.svn.wordpress.org/branches/4.9@43466 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-terms-controller.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php index 42bfd6653e..2ff122eeb8 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php @@ -441,7 +441,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller { $schema = $this->get_item_schema(); 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 ) ) { return $meta_update; diff --git a/wp-includes/version.php b/wp-includes/version.php index df482a5e96..0cffa0e5b2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.9-alpha-43632'; +$wp_version = '4.9.9-alpha-43637'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.