Make WordPress Core


Ignore:
Timestamp:
12/03/2017 06:10:05 PM (7 years ago)
Author:
rachelbaker
Message:

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.

File:
1 edited

Legend:

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

    r42343 r42350  
    420420                $existing_term = get_term( $term_id, $this->taxonomy );
    421421                $term->add_data( $existing_term->term_id, 'term_exists' );
    422                 $term->add_data( array( 'status' => 409 ) );
     422                $term->add_data( array( 'status' => 409, 'term_id' => $term_id ) );
    423423            }
    424424
Note: See TracChangeset for help on using the changeset viewer.