REST API: Prevent translating the hook name in a `_doing_it_wrong()` message by using a placeholder.

See #45265.
Built from https://develop.svn.wordpress.org/trunk@44698


git-svn-id: http://core.svn.wordpress.org/trunk@44529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2019-01-26 12:29:54 +00:00
parent c31e8cf756
commit fe73f310d4
2 changed files with 10 additions and 2 deletions

View File

@ -45,7 +45,15 @@ function register_rest_route( $namespace, $route, $args = array(), $override = f
}
if ( ! did_action( 'rest_api_init' ) ) {
_doing_it_wrong( 'register_rest_route', __( 'REST API routes must be registered on the rest_api_init action.' ), '5.1.0' );
_doing_it_wrong(
'register_rest_route',
sprintf(
/* translators: %s: rest_api_init */
__( 'REST API routes must be registered on the %s action.' ),
'<code>rest_api_init</code>'
),
'5.1.0'
);
}
if ( isset( $args['args'] ) ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta2-44697';
$wp_version = '5.1-beta2-44698';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.