From d763cdf82c2b1c1493674d348e02f18cc266672a Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Sat, 26 Jan 2019 12:28:15 +0000 Subject: [PATCH] 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 --- src/wp-includes/rest-api.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index d0066ff0fe..a2e3363951 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -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.' ), + 'rest_api_init' + ), + '5.1.0' + ); } if ( isset( $args['args'] ) ) {