From 9d7ea04936125041b224b227f48ad4194066b314 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 29 Jan 2017 11:50:41 +0000 Subject: [PATCH] I18N: Merge similar strings in `_deprecated_argument()` calls. Add translator comments. Props ramiy, SergeyBiryukov. Fixes #39020. Built from https://develop.svn.wordpress.org/trunk@40028 git-svn-id: http://core.svn.wordpress.org/trunk@39965 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 28 ++++++++++++++++++++---- wp-includes/category-template.php | 2 +- wp-includes/category.php | 2 +- wp-includes/class-wp-query.php | 12 +++++++++-- wp-includes/option.php | 36 ++++++++++++++++++++++++++----- wp-includes/version.php | 2 +- 6 files changed, 68 insertions(+), 14 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 4e75c0e283..0da0b0d9bf 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1207,12 +1207,22 @@ function add_settings_section($id, $title, $callback, $page) { global $wp_settings_sections; if ( 'misc' == $page ) { - _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) ); + _deprecated_argument( __FUNCTION__, '3.0.0', + /* translators: %s: misc */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'misc' + ) + ); $page = 'general'; } if ( 'privacy' == $page ) { - _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) ); + _deprecated_argument( __FUNCTION__, '3.5.0', + /* translators: %s: privacy */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'privacy' + ) + ); $page = 'reading'; } @@ -1258,12 +1268,22 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default', global $wp_settings_fields; if ( 'misc' == $page ) { - _deprecated_argument( __FUNCTION__, '3.0.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) ); + _deprecated_argument( __FUNCTION__, '3.0.0', + /* translators: %s: misc */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'misc' + ) + ); $page = 'general'; } if ( 'privacy' == $page ) { - _deprecated_argument( __FUNCTION__, '3.5.0', __( 'The privacy options group has been removed. Use another settings group.' ) ); + _deprecated_argument( __FUNCTION__, '3.5.0', + /* translators: %s: privacy */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'privacy' + ) + ); $page = 'reading'; } diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index bf4a0f4175..150ef0a2ef 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -342,8 +342,8 @@ function wp_dropdown_categories( $args = '' ) { // Back compat. if ( isset( $args['type'] ) && 'link' == $args['type'] ) { - /* translators: 1: "type => link", 2: "taxonomy => link_category" alternative */ _deprecated_argument( __FUNCTION__, '3.0.0', + /* translators: 1: "type => link", 2: "taxonomy => link_category" */ sprintf( __( '%1$s is deprecated. Use %2$s instead.' ), 'type => link', 'taxonomy => link_category' diff --git a/wp-includes/category.php b/wp-includes/category.php index 2ab54a5a94..5b990d34b5 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -41,8 +41,8 @@ function get_categories( $args = '' ) { // Back compat if ( isset($args['type']) && 'link' == $args['type'] ) { - /* translators: 1: "type => link", 2: "taxonomy => link_category" alternative */ _deprecated_argument( __FUNCTION__, '3.0.0', + /* translators: 1: "type => link", 2: "taxonomy => link_category" */ sprintf( __( '%1$s is deprecated. Use %2$s instead.' ), 'type => link', 'taxonomy => link_category' diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 00a085dfaa..6936345905 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -1713,9 +1713,17 @@ class WP_Query { $page = 1; if ( isset( $q['caller_get_posts'] ) ) { - _deprecated_argument( 'WP_Query', '3.1.0', __( '"caller_get_posts" is deprecated. Use "ignore_sticky_posts" instead.' ) ); - if ( !isset( $q['ignore_sticky_posts'] ) ) + _deprecated_argument( 'WP_Query', '3.1.0', + /* translators: 1: caller_get_posts, 2: ignore_sticky_posts */ + sprintf( __( '%1$s is deprecated. Use %2$s instead.' ), + 'caller_get_posts', + 'ignore_sticky_posts' + ) + ); + + if ( ! isset( $q['ignore_sticky_posts'] ) ) { $q['ignore_sticky_posts'] = $q['caller_get_posts']; + } } if ( !isset( $q['ignore_sticky_posts'] ) ) diff --git a/wp-includes/option.php b/wp-includes/option.php index 67df23f9db..d58ae6983f 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -1913,12 +1913,22 @@ function register_setting( $option_group, $option_name, $args = array() ) { } if ( 'misc' == $option_group ) { - _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) ); + _deprecated_argument( __FUNCTION__, '3.0.0', + /* translators: %s: misc */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'misc' + ) + ); $option_group = 'general'; } if ( 'privacy' == $option_group ) { - _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) ); + _deprecated_argument( __FUNCTION__, '3.5.0', + /* translators: %s: privacy */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'privacy' + ) + ); $option_group = 'reading'; } @@ -1949,12 +1959,22 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) { global $new_whitelist_options, $wp_registered_settings; if ( 'misc' == $option_group ) { - _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) ); + _deprecated_argument( __FUNCTION__, '3.0.0', + /* translators: %s: misc */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'misc' + ) + ); $option_group = 'general'; } if ( 'privacy' == $option_group ) { - _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) ); + _deprecated_argument( __FUNCTION__, '3.5.0', + /* translators: %s: privacy */ + sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), + 'privacy' + ) + ); $option_group = 'reading'; } @@ -1963,7 +1983,13 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) { unset( $new_whitelist_options[ $option_group ][ $pos ] ); } if ( '' !== $deprecated ) { - _deprecated_argument( __FUNCTION__, '4.7.0', __( '$sanitize_callback is deprecated. The callback from register_setting() is used instead.' ) ); + _deprecated_argument( __FUNCTION__, '4.7.0', + /* translators: 1: $sanitize_callback, 2: register_setting() */ + sprintf( __( '%1$s is deprecated. The callback from %2$s is used instead.' ), + '$sanitize_callback', + 'register_setting()' + ) + ); remove_filter( "sanitize_option_{$option_name}", $deprecated ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 94f940bf6a..9aee36e5f2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40027'; +$wp_version = '4.8-alpha-40028'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.