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

See #45265.

git-svn-id: https://develop.svn.wordpress.org/trunk@44698 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2019-01-26 12:28:15 +00:00
parent e01f30ae20
commit d763cdf82c
1 changed files with 9 additions and 1 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'] ) ) {