REST API: Display the actual conflicting value in addition to the taxonomy name in the _doing_it_wrong() message for a conflicting rest_base or name property.

Follow-up to [47037] and [47045].

Props TimothyBlynJacobs.
See #48401.
Built from https://develop.svn.wordpress.org/trunk@47046


git-svn-id: http://core.svn.wordpress.org/trunk@46846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-01-06 17:09:04 +00:00
parent a540d748d3
commit ce48d7502c
2 changed files with 5 additions and 4 deletions

View File

@ -2249,10 +2249,11 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
_doing_it_wrong( _doing_it_wrong(
'register_taxonomy', 'register_taxonomy',
sprintf( sprintf(
/* translators: 1. The taxonomy name, 2. The property name, either 'rest_base' or 'name'. */ /* translators: 1. The taxonomy name, 2. The property name, either 'rest_base' or 'name', 3. The conflicting value. */
__( 'The "%1$s" taxonomy "%2$s" conflicts with an existing property on the REST API Posts Controller. Specify a custom "rest_base" when registering the taxonomy to avoid this error.' ), __( 'The "%1$s" taxonomy "%2$s" property (%3$s) conflicts with an existing property on the REST API Posts Controller. Specify a custom "rest_base" when registering the taxonomy to avoid this error.' ),
$taxonomy->name, $taxonomy->name,
$taxonomy_field_name_with_conflict $taxonomy_field_name_with_conflict,
$base
), ),
'5.4.0' '5.4.0'
); );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.4-alpha-47045'; $wp_version = '5.4-alpha-47046';
/** /**
* 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.