mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
REST API: Add existing term_id to the error data object when attempting to create a duplicate term.
Props shooper, coleh. Fixes #42597. See #41370. git-svn-id: https://develop.svn.wordpress.org/trunk@42350 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -419,7 +419,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
if ( $term_id = $term->get_error_data( 'term_exists' ) ) {
|
||||
$existing_term = get_term( $term_id, $this->taxonomy );
|
||||
$term->add_data( $existing_term->term_id, 'term_exists' );
|
||||
$term->add_data( array( 'status' => 409 ) );
|
||||
$term->add_data( array( 'status' => 409, 'term_id' => $term_id ) );
|
||||
}
|
||||
|
||||
return $term;
|
||||
|
||||
Reference in New Issue
Block a user