mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-07 08:07:16 +00:00
I18N: Improve translator comments.
* Add missing translator comments. * Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments. Includes minor code layout fixes. Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders! Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov. Fixes #44360. git-svn-id: https://develop.svn.wordpress.org/trunk@45926 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -896,7 +896,7 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
||||
$awaiting_mod = wp_count_comments();
|
||||
$awaiting_mod = $awaiting_mod->moderated;
|
||||
$awaiting_text = sprintf(
|
||||
/* translators: %s: number of comments in moderation */
|
||||
/* translators: %s: number of comments */
|
||||
_n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ),
|
||||
number_format_i18n( $awaiting_mod )
|
||||
);
|
||||
|
||||
@@ -65,8 +65,8 @@ function the_author( $deprecated = '', $deprecated_echo = true ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'1.5.0',
|
||||
/* translators: %s: get_the_author() */
|
||||
sprintf(
|
||||
/* translators: %s: get_the_author() */
|
||||
__( 'Use %s instead if you do not want the value echoed.' ),
|
||||
'<code>get_the_author()</code>'
|
||||
)
|
||||
|
||||
@@ -86,6 +86,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
|
||||
if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) {
|
||||
$title .= ' (';
|
||||
$title .= sprintf(
|
||||
/* translators: %s: date and time of last update */
|
||||
__( 'Last updated: %s' ),
|
||||
gmdate(
|
||||
get_option( 'links_updated_date_format' ),
|
||||
|
||||
@@ -355,8 +355,8 @@ function wp_dropdown_categories( $args = '' ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'3.0.0',
|
||||
/* translators: 1: "type => link", 2: "taxonomy => link_category" */
|
||||
sprintf(
|
||||
/* translators: 1: "type => link", 2: "taxonomy => link_category" */
|
||||
__( '%1$s is deprecated. Use %2$s instead.' ),
|
||||
'<code>type => link</code>',
|
||||
'<code>taxonomy => link_category</code>'
|
||||
@@ -831,6 +831,7 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||
} elseif ( ! empty( $args['topic_count_text_callback'] ) ) {
|
||||
// Look for the alternative callback style. Ignore the previous default.
|
||||
if ( $args['topic_count_text_callback'] === 'default_topic_count_text' ) {
|
||||
/* translators: %s: number of items (tags) */
|
||||
$translate_nooped_plural = _n_noop( '%s item', '%s items' );
|
||||
} else {
|
||||
$translate_nooped_plural = false;
|
||||
@@ -841,6 +842,7 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||
$translate_nooped_plural = _n_noop( $args['single_text'], $args['multiple_text'] );
|
||||
} else {
|
||||
// This is the default for when no callback, plural, or argument is passed in.
|
||||
/* translators: %s: number of items (tags) */
|
||||
$translate_nooped_plural = _n_noop( '%s item', '%s items' );
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ function get_categories( $args = '' ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'3.0.0',
|
||||
/* translators: 1: "type => link", 2: "taxonomy => link_category" */
|
||||
sprintf(
|
||||
/* translators: 1: "type => link", 2: "taxonomy => link_category" */
|
||||
__( '%1$s is deprecated. Use %2$s instead.' ),
|
||||
'<code>type => link</code>',
|
||||
'<code>taxonomy => link_category</code>'
|
||||
|
||||
@@ -282,8 +282,8 @@ class Walker_Comment extends Walker {
|
||||
echo get_avatar( $comment, $args['avatar_size'] );}
|
||||
?>
|
||||
<?php
|
||||
/* translators: %s: comment author link */
|
||||
printf(
|
||||
/* translators: %s: comment author link */
|
||||
__( '%s <span class="says">says:</span>' ),
|
||||
sprintf( '<cite class="fn">%s</cite>', get_comment_author_link( $comment ) )
|
||||
);
|
||||
@@ -368,11 +368,12 @@ class Walker_Comment extends Walker {
|
||||
<div class="comment-author vcard">
|
||||
<?php
|
||||
if ( 0 != $args['avatar_size'] ) {
|
||||
echo get_avatar( $comment, $args['avatar_size'] );}
|
||||
echo get_avatar( $comment, $args['avatar_size'] );
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/* translators: %s: comment author link */
|
||||
printf(
|
||||
/* translators: %s: comment author link */
|
||||
__( '%s <span class="says">says:</span>' ),
|
||||
sprintf( '<b class="fn">%s</b>', get_comment_author_link( $comment ) )
|
||||
);
|
||||
|
||||
@@ -3820,8 +3820,8 @@ final class WP_Customize_Manager {
|
||||
public function remove_panel( $id ) {
|
||||
// Removing core components this way is _doing_it_wrong().
|
||||
if ( in_array( $id, $this->components, true ) ) {
|
||||
/* translators: 1: panel id, 2: link to 'customize_loaded_components' filter reference */
|
||||
$message = sprintf(
|
||||
/* translators: 1: panel id, 2: link to 'customize_loaded_components' filter reference */
|
||||
__( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ),
|
||||
$id,
|
||||
'<a href="' . esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ) . '"><code>customize_loaded_components</code></a>'
|
||||
|
||||
@@ -466,7 +466,9 @@ final class WP_Customize_Nav_Menus {
|
||||
'invalidTitleTpl' => __( '%s (Invalid)' ),
|
||||
/* translators: %s: title of menu item in draft status */
|
||||
'pendingTitleTpl' => __( '%s (Pending)' ),
|
||||
/* translators: %d: number of menu items found */
|
||||
'itemsFound' => __( 'Number of items found: %d' ),
|
||||
/* translators: %d: number of additional menu items found */
|
||||
'itemsFoundMore' => __( 'Additional items found: %d' ),
|
||||
'itemsLoadingMore' => __( 'Loading more results... please wait.' ),
|
||||
'reorderModeOn' => __( 'Reorder mode enabled' ),
|
||||
@@ -590,8 +592,11 @@ final class WP_Customize_Nav_Menus {
|
||||
// Create a panel for Menus.
|
||||
$description = '<p>' . __( 'This panel is used for managing navigation menus for content you have already published on your site. You can create menus and add items for existing content such as pages, posts, categories, tags, formats, or custom links.' ) . '</p>';
|
||||
if ( current_theme_supports( 'widgets' ) ) {
|
||||
/* translators: URL to the widgets panel of the customizer */
|
||||
$description .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme or in <a href="%s">widget areas</a> by adding a “Navigation Menu” widget.' ), "javascript:wp.customize.panel( 'widgets' ).focus();" ) . '</p>';
|
||||
$description .= '<p>' . sprintf(
|
||||
/* translators: %s: URL to the widgets panel of the customizer */
|
||||
__( 'Menus can be displayed in locations defined by your theme or in <a href="%s">widget areas</a> by adding a “Navigation Menu” widget.' ),
|
||||
"javascript:wp.customize.panel( 'widgets' ).focus();"
|
||||
) . '</p>';
|
||||
} else {
|
||||
$description .= '<p>' . __( 'Menus can be displayed in locations defined by your theme.' ) . '</p>';
|
||||
}
|
||||
|
||||
@@ -425,8 +425,8 @@ class WP_Date_Query {
|
||||
if ( $day_exists && $month_exists && $year_exists ) {
|
||||
// 1. Checking day, month, year combination.
|
||||
if ( ! wp_checkdate( $date_query['month'], $date_query['day'], $date_query['year'], sprintf( '%s-%s-%s', $date_query['year'], $date_query['month'], $date_query['day'] ) ) ) {
|
||||
/* translators: 1: year, 2: month, 3: day of month */
|
||||
$day_month_year_error_msg = sprintf(
|
||||
/* translators: 1: year, 2: month, 3: day of month */
|
||||
__( 'The following values do not describe a valid date: year %1$s, month %2$s, day %3$s.' ),
|
||||
'<code>' . esc_html( $date_query['year'] ) . '</code>',
|
||||
'<code>' . esc_html( $date_query['month'] ) . '</code>',
|
||||
@@ -441,8 +441,8 @@ class WP_Date_Query {
|
||||
* We use 2012 because, as a leap year, it's the most permissive.
|
||||
*/
|
||||
if ( ! wp_checkdate( $date_query['month'], $date_query['day'], 2012, sprintf( '2012-%s-%s', $date_query['month'], $date_query['day'] ) ) ) {
|
||||
/* translators: 1: month, 2: day of month */
|
||||
$day_month_year_error_msg = sprintf(
|
||||
/* translators: 1: month, 2: day of month */
|
||||
__( 'The following values do not describe a valid date: month %1$s, day %2$s.' ),
|
||||
'<code>' . esc_html( $date_query['month'] ) . '</code>',
|
||||
'<code>' . esc_html( $date_query['day'] ) . '</code>'
|
||||
|
||||
@@ -1788,8 +1788,8 @@ class WP_Query {
|
||||
_deprecated_argument(
|
||||
'WP_Query',
|
||||
'3.1.0',
|
||||
/* translators: 1: caller_get_posts, 2: ignore_sticky_posts */
|
||||
sprintf(
|
||||
/* translators: 1: caller_get_posts, 2: ignore_sticky_posts */
|
||||
__( '%1$s is deprecated. Use %2$s instead.' ),
|
||||
'<code>caller_get_posts</code>',
|
||||
'<code>ignore_sticky_posts</code>'
|
||||
|
||||
@@ -226,7 +226,14 @@ final class WP_Theme implements ArrayAccess {
|
||||
} elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
|
||||
$this->headers['Name'] = $this->stylesheet;
|
||||
if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) ) {
|
||||
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
|
||||
$this->errors = new WP_Error(
|
||||
'theme_not_found',
|
||||
sprintf(
|
||||
/* translators: %s: theme directory name */
|
||||
__( 'The theme directory "%s" does not exist.' ),
|
||||
esc_html( $this->stylesheet )
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
|
||||
}
|
||||
@@ -271,8 +278,14 @@ final class WP_Theme implements ArrayAccess {
|
||||
}
|
||||
|
||||
if ( ! $this->template && $this->stylesheet === $this->headers['Template'] ) {
|
||||
/* translators: %s: Template */
|
||||
$this->errors = new WP_Error( 'theme_child_invalid', sprintf( __( 'The theme defines itself as its parent theme. Please check the %s header.' ), '<code>Template</code>' ) );
|
||||
$this->errors = new WP_Error(
|
||||
'theme_child_invalid',
|
||||
sprintf(
|
||||
/* translators: %s: Template */
|
||||
__( 'The theme defines itself as its parent theme. Please check the %s header.' ),
|
||||
'<code>Template</code>'
|
||||
)
|
||||
);
|
||||
$this->cache_add(
|
||||
'theme',
|
||||
array(
|
||||
@@ -328,7 +341,14 @@ final class WP_Theme implements ArrayAccess {
|
||||
$theme_root_template = $directories[ $this->template ]['theme_root'];
|
||||
} else {
|
||||
// Parent theme is missing.
|
||||
$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->errors = new WP_Error(
|
||||
'theme_no_parent',
|
||||
sprintf(
|
||||
/* translators: %s: theme directory name */
|
||||
__( 'The parent theme is missing. Please install the "%s" parent theme.' ),
|
||||
esc_html( $this->template )
|
||||
)
|
||||
);
|
||||
$this->cache_add(
|
||||
'theme',
|
||||
array(
|
||||
@@ -348,7 +368,14 @@ final class WP_Theme implements ArrayAccess {
|
||||
// If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
|
||||
if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
|
||||
$_child->parent = null;
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
|
||||
$_child->errors = new WP_Error(
|
||||
'theme_parent_invalid',
|
||||
sprintf(
|
||||
/* translators: %s: theme directory name */
|
||||
__( 'The "%s" theme is not a valid parent theme.' ),
|
||||
esc_html( $_child->template )
|
||||
)
|
||||
);
|
||||
$_child->cache_add(
|
||||
'theme',
|
||||
array(
|
||||
@@ -360,7 +387,14 @@ final class WP_Theme implements ArrayAccess {
|
||||
);
|
||||
// The two themes actually reference each other with the Template header.
|
||||
if ( $_child->stylesheet == $this->template ) {
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->errors = new WP_Error(
|
||||
'theme_parent_invalid',
|
||||
sprintf(
|
||||
/* translators: %s: theme directory name */
|
||||
__( 'The "%s" theme is not a valid parent theme.' ),
|
||||
esc_html( $this->template )
|
||||
)
|
||||
);
|
||||
$this->cache_add(
|
||||
'theme',
|
||||
array(
|
||||
|
||||
@@ -1151,8 +1151,8 @@ function trackback_url( $deprecated_echo = true ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'2.5.0',
|
||||
/* translators: %s: get_trackback_url() */
|
||||
sprintf(
|
||||
/* translators: %s: get_trackback_url() */
|
||||
__( 'Use %s instead if you do not want the value echoed.' ),
|
||||
'<code>get_trackback_url()</code>'
|
||||
)
|
||||
@@ -1934,6 +1934,7 @@ function comment_form_title( $noreplytext = false, $replytext = false, $linktopa
|
||||
$noreplytext = __( 'Leave a Reply' );
|
||||
}
|
||||
if ( false === $replytext ) {
|
||||
/* translators: %s: author of the comment being replied to */
|
||||
$replytext = __( 'Leave a Reply to %s' );
|
||||
}
|
||||
|
||||
@@ -2292,7 +2293,11 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$required_text = sprintf( ' ' . __( 'Required fields are marked %s' ), '<span class="required">*</span>' );
|
||||
$required_text = sprintf(
|
||||
/* translators: %s: an asterisk symbol (*) */
|
||||
' ' . __( 'Required fields are marked %s' ),
|
||||
'<span class="required">*</span>'
|
||||
);
|
||||
|
||||
/**
|
||||
* Filters the default comment form fields.
|
||||
@@ -2308,16 +2313,16 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
/** This filter is documented in wp-includes/link-template.php */
|
||||
'must_log_in' => '<p class="must-log-in">' . sprintf(
|
||||
/* translators: %s: login URL */
|
||||
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
|
||||
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
|
||||
wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
|
||||
) . '</p>',
|
||||
/** This filter is documented in wp-includes/link-template.php */
|
||||
'logged_in_as' => '<p class="logged-in-as">' . sprintf(
|
||||
/* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
|
||||
__( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
|
||||
__( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
|
||||
get_edit_user_link(),
|
||||
/* translators: %s: user name */
|
||||
esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
|
||||
esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
|
||||
$user_identity,
|
||||
wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
|
||||
) . '</p>',
|
||||
@@ -2330,6 +2335,7 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
'class_submit' => 'submit',
|
||||
'name_submit' => 'submit',
|
||||
'title_reply' => __( 'Leave a Reply' ),
|
||||
/* translators: %s: author of the comment being replied to */
|
||||
'title_reply_to' => __( 'Leave a Reply to %s' ),
|
||||
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">',
|
||||
'title_reply_after' => '</h3>',
|
||||
|
||||
@@ -1084,6 +1084,7 @@ function print_embed_comments_button() {
|
||||
<span class="dashicons dashicons-admin-comments"></span>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: number of comments */
|
||||
_n(
|
||||
'%s <span class="screen-reader-text">Comment</span>',
|
||||
'%s <span class="screen-reader-text">Comments</span>',
|
||||
|
||||
@@ -2525,7 +2525,10 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
|
||||
|
||||
$ifp = @fopen( $new_file, 'wb' );
|
||||
if ( ! $ifp ) {
|
||||
return array( 'error' => sprintf( __( 'Could not write file %s' ), $new_file ) );
|
||||
return array(
|
||||
/* translators: %s: file name */
|
||||
'error' => sprintf( __( 'Could not write file %s' ), $new_file ),
|
||||
);
|
||||
}
|
||||
|
||||
fwrite( $ifp, $bits );
|
||||
@@ -4630,9 +4633,9 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) {
|
||||
if ( WP_DEBUG && apply_filters( 'deprecated_constructor_trigger_error', true ) ) {
|
||||
if ( function_exists( '__' ) ) {
|
||||
if ( ! empty( $parent_class ) ) {
|
||||
/* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
|
||||
trigger_error(
|
||||
sprintf(
|
||||
/* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
|
||||
__( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
|
||||
$class,
|
||||
$parent_class,
|
||||
@@ -4641,9 +4644,9 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) {
|
||||
)
|
||||
);
|
||||
} else {
|
||||
/* translators: 1: PHP class name, 2: version number, 3: __construct() method */
|
||||
trigger_error(
|
||||
sprintf(
|
||||
/* translators: 1: PHP class name, 2: version number, 3: __construct() method */
|
||||
__( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
|
||||
$class,
|
||||
$version,
|
||||
@@ -4901,8 +4904,8 @@ function _doing_it_wrong( $function, $message, $version ) {
|
||||
/* translators: %s: version number */
|
||||
$version = sprintf( __( '(This message was added in version %s.)' ), $version );
|
||||
}
|
||||
/* translators: %s: Documentation URL */
|
||||
$message .= ' ' . sprintf(
|
||||
/* translators: %s: Documentation URL */
|
||||
__( 'Please see <a href="%s">Debugging in WordPress</a> for more information.' ),
|
||||
__( 'https://wordpress.org/support/article/debugging-in-wordpress/' )
|
||||
);
|
||||
@@ -6756,6 +6759,7 @@ All at ###SITENAME###
|
||||
'message' => $email_change_text,
|
||||
'headers' => '',
|
||||
);
|
||||
|
||||
// get site name
|
||||
$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
||||
|
||||
|
||||
@@ -1097,6 +1097,7 @@ function wp_get_document_title() {
|
||||
|
||||
// Add a page number if necessary.
|
||||
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
|
||||
/* translators: %s: page number */
|
||||
$title['page'] = sprintf( __( 'Page %s' ), max( $paged, $page ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1711,7 +1711,15 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo
|
||||
if ( ! empty( $excluded_terms ) && ! is_array( $excluded_terms ) ) {
|
||||
// Back-compat, $excluded_terms used to be $excluded_categories with IDs separated by " and ".
|
||||
if ( false !== strpos( $excluded_terms, ' and ' ) ) {
|
||||
_deprecated_argument( __FUNCTION__, '3.3.0', sprintf( __( 'Use commas instead of %s to separate excluded terms.' ), "'and'" ) );
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'3.3.0',
|
||||
sprintf(
|
||||
/* translators: %s: the word 'and' */
|
||||
__( 'Use commas instead of %s to separate excluded terms.' ),
|
||||
"'and'"
|
||||
)
|
||||
);
|
||||
$excluded_terms = explode( ' and ', $excluded_terms );
|
||||
} else {
|
||||
$excluded_terms = explode( ',', $excluded_terms );
|
||||
|
||||
@@ -489,8 +489,8 @@ function wp_set_wpdb_vars() {
|
||||
if ( is_wp_error( $prefix ) ) {
|
||||
wp_load_translations_early();
|
||||
wp_die(
|
||||
/* translators: 1: $table_prefix, 2: wp-config.php */
|
||||
sprintf(
|
||||
/* translators: 1: $table_prefix, 2: wp-config.php */
|
||||
__( '<strong>ERROR</strong>: %1$s in %2$s can only contain numbers, letters, and underscores.' ),
|
||||
'<code>$table_prefix</code>',
|
||||
'<code>wp-config.php</code>'
|
||||
|
||||
@@ -222,8 +222,16 @@ function wp_print_media_templates() {
|
||||
<# } #>
|
||||
<?php if ( ! _device_can_upload() ) : ?>
|
||||
<div class="upload-ui">
|
||||
<h2 class="upload-instructions"><?php _e( 'Your browseer cannot upload files' ); ?></h2>
|
||||
<p><?php printf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ); ?></p>
|
||||
<h2 class="upload-instructions"><?php _e( 'Your browser cannot upload files' ); ?></h2>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: https://apps.wordpress.org/ */
|
||||
__( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ),
|
||||
'https://apps.wordpress.org/'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?>
|
||||
<div class="upload-ui">
|
||||
@@ -266,7 +274,11 @@ function wp_print_media_templates() {
|
||||
|
||||
<p class="max-upload-size">
|
||||
<?php
|
||||
printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) );
|
||||
printf(
|
||||
/* translators: %s: maximum allowed file size */
|
||||
__( 'Maximum upload file size: %s.' ),
|
||||
esc_html( size_format( $max_upload_size ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -3705,7 +3705,12 @@ function wp_enqueue_media( $args = array() ) {
|
||||
);
|
||||
}
|
||||
foreach ( $months as $month_year ) {
|
||||
$month_year->text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month_year->month ), $month_year->year );
|
||||
$month_year->text = sprintf(
|
||||
/* translators: 1: month, 2: year */
|
||||
__( '%1$s %2$d' ),
|
||||
$wp_locale->get_month( $month_year->month ),
|
||||
$month_year->year
|
||||
);
|
||||
}
|
||||
|
||||
$settings = array(
|
||||
|
||||
@@ -944,6 +944,7 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $us
|
||||
*/
|
||||
apply_filters(
|
||||
'wpmu_signup_blog_notification_email',
|
||||
/* translators: New site notification email. 1: Activation URL, 2: New site URL */
|
||||
__( "To activate your blog, please click the following link:\n\n%1\$s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%2\$s" ),
|
||||
$domain,
|
||||
$path,
|
||||
@@ -957,6 +958,7 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $us
|
||||
esc_url( "http://{$domain}{$path}" ),
|
||||
$key
|
||||
);
|
||||
|
||||
// TODO: Don't hard code activation link.
|
||||
$subject = sprintf(
|
||||
/**
|
||||
@@ -988,6 +990,7 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $us
|
||||
$from_name,
|
||||
esc_url( 'http://' . $domain . $path )
|
||||
);
|
||||
|
||||
wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
|
||||
|
||||
if ( $switched_locale ) {
|
||||
@@ -1060,6 +1063,7 @@ function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta =
|
||||
*/
|
||||
apply_filters(
|
||||
'wpmu_signup_user_notification_email',
|
||||
/* translators: New user notification email. %s: Activation URL */
|
||||
__( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login." ),
|
||||
$user_login,
|
||||
$user_email,
|
||||
@@ -1068,6 +1072,7 @@ function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta =
|
||||
),
|
||||
site_url( "wp-activate.php?key=$key" )
|
||||
);
|
||||
|
||||
// TODO: Don't hard code activation link.
|
||||
$subject = sprintf(
|
||||
/**
|
||||
@@ -1093,6 +1098,7 @@ function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta =
|
||||
$from_name,
|
||||
$user_login
|
||||
);
|
||||
|
||||
wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
|
||||
|
||||
if ( $switched_locale ) {
|
||||
@@ -1378,8 +1384,8 @@ function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
|
||||
$siteurl = site_url();
|
||||
restore_current_blog();
|
||||
|
||||
/* translators: New site notification email. 1: Site URL, 2: User IP address, 3: Settings screen URL */
|
||||
$msg = sprintf(
|
||||
/* translators: New site notification email. 1: Site URL, 2: User IP address, 3: Settings screen URL */
|
||||
__(
|
||||
'New Site: %1$s
|
||||
URL: %2$s
|
||||
@@ -1402,7 +1408,9 @@ Disable these notifications: %4$s'
|
||||
*/
|
||||
$msg = apply_filters( 'newblog_notify_siteadmin', $msg );
|
||||
|
||||
/* translators: New site notification email subject. %s: New site URL */
|
||||
wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1431,8 +1439,9 @@ function newuser_notify_siteadmin( $user_id ) {
|
||||
$user = get_userdata( $user_id );
|
||||
|
||||
$options_site_url = esc_url( network_admin_url( 'settings.php' ) );
|
||||
/* translators: New user notification email. 1: User login, 2: User IP address, 3: Settings screen URL */
|
||||
|
||||
$msg = sprintf(
|
||||
/* translators: New user notification email. 1: User login, 2: User IP address, 3: Settings screen URL */
|
||||
__(
|
||||
'New User: %1$s
|
||||
Remote IP address: %2$s
|
||||
@@ -1454,7 +1463,10 @@ Disable these notifications: %3$s'
|
||||
* @param WP_User $user WP_User instance of the new user.
|
||||
*/
|
||||
$msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );
|
||||
|
||||
/* translators: New user notification email subject. %s: User login */
|
||||
wp_mail( $email, sprintf( __( 'New User Registration: %s' ), $user->user_login ), $msg );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1613,6 +1625,7 @@ We hope you enjoy your new site. Thanks!
|
||||
* @param string $subject Subject of the email.
|
||||
*/
|
||||
$subject = apply_filters( 'update_welcome_subject', sprintf( $subject, $current_network->site_name, wp_unslash( $title ) ) );
|
||||
|
||||
wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
|
||||
|
||||
if ( $switched_locale ) {
|
||||
@@ -1704,6 +1717,7 @@ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() )
|
||||
* @param string $subject Subject of the email.
|
||||
*/
|
||||
$subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login ) );
|
||||
|
||||
wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
|
||||
|
||||
if ( $switched_locale ) {
|
||||
@@ -2075,10 +2089,25 @@ function maybe_add_existing_user_to_blog() {
|
||||
}
|
||||
|
||||
if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) {
|
||||
wp_die( sprintf( __( 'An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.' ), home_url() ) );
|
||||
wp_die(
|
||||
sprintf(
|
||||
/* translators: %s: Home URL */
|
||||
__( 'An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.' ),
|
||||
home_url()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%1$s">homepage</a> or <a href="%2$s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress › Success' ), array( 'response' => 200 ) );
|
||||
wp_die(
|
||||
sprintf(
|
||||
/* translators: 1: Home URL, 2: Admin URL */
|
||||
__( 'You have been added to this site. Please visit the <a href="%1$s">homepage</a> or <a href="%2$s">log in</a> using your username and password.' ),
|
||||
home_url(),
|
||||
admin_url()
|
||||
),
|
||||
__( 'WordPress › Success' ),
|
||||
array( 'response' => 200 )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2651,8 +2680,15 @@ All at ###SITENAME###
|
||||
$content = str_replace( '###SITENAME###', wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ), $content );
|
||||
$content = str_replace( '###SITEURL###', network_home_url(), $content );
|
||||
|
||||
/* translators: Email change notification email subject. %s: Network title */
|
||||
wp_mail( $value, sprintf( __( '[%s] Network Admin Email Change Request' ), wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ) ), $content );
|
||||
wp_mail(
|
||||
$value,
|
||||
sprintf(
|
||||
/* translators: Email change notification email subject. %s: Network title */
|
||||
__( '[%s] Network Admin Email Change Request' ),
|
||||
wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES )
|
||||
),
|
||||
$content
|
||||
);
|
||||
|
||||
if ( $switched_locale ) {
|
||||
restore_previous_locale();
|
||||
|
||||
@@ -106,8 +106,8 @@ function ms_site_check() {
|
||||
} else {
|
||||
$admin_email = str_replace( '@', ' AT ', get_site_option( 'admin_email', 'support@' . get_network()->domain ) );
|
||||
wp_die(
|
||||
/* translators: %s: admin email link */
|
||||
sprintf(
|
||||
/* translators: %s: admin email link */
|
||||
__( 'This site has not been activated yet. If you are having problems activating your site, please contact %s.' ),
|
||||
sprintf( '<a href="mailto:%1$s">%1$s</a>', $admin_email )
|
||||
)
|
||||
@@ -489,8 +489,8 @@ function ms_not_installed( $domain, $path ) {
|
||||
) . '</p>';
|
||||
}
|
||||
$msg .= '<p><strong>' . __( 'What do I do now?' ) . '</strong> ';
|
||||
/* translators: %s: Documentation URL */
|
||||
$msg .= sprintf(
|
||||
/* translators: %s: Documentation URL */
|
||||
__( 'Read the <a href="%s" target="_blank">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.' ),
|
||||
__( 'https://wordpress.org/support/article/debugging-a-wordpress-network/' )
|
||||
);
|
||||
|
||||
@@ -327,8 +327,8 @@ function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {
|
||||
) {
|
||||
return new WP_Error(
|
||||
'menu_exists',
|
||||
/* translators: %s: menu name */
|
||||
sprintf(
|
||||
/* translators: %s: menu name */
|
||||
__( 'The menu name %s conflicts with another menu name. Please try another.' ),
|
||||
'<strong>' . esc_html( $menu_data['menu-name'] ) . '</strong>'
|
||||
)
|
||||
@@ -342,8 +342,8 @@ function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {
|
||||
if ( $menu_exists ) {
|
||||
return new WP_Error(
|
||||
'menu_exists',
|
||||
/* translators: %s: menu name */
|
||||
sprintf(
|
||||
/* translators: %s: menu name */
|
||||
__( 'The menu name %s conflicts with another menu name. Please try another.' ),
|
||||
'<strong>' . esc_html( $menu_data['menu-name'] ) . '</strong>'
|
||||
)
|
||||
|
||||
@@ -164,7 +164,13 @@ function get_option( $option, $default = false ) {
|
||||
*/
|
||||
function wp_protect_special_option( $option ) {
|
||||
if ( 'alloptions' === $option || 'notoptions' === $option ) {
|
||||
wp_die( sprintf( __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) );
|
||||
wp_die(
|
||||
sprintf(
|
||||
/* translators: %s: option name */
|
||||
__( '%s is a protected WP option and may not be modified' ),
|
||||
esc_html( $option )
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2136,8 +2142,8 @@ function register_setting( $option_group, $option_name, $args = array() ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'3.0.0',
|
||||
/* translators: %s: misc */
|
||||
sprintf(
|
||||
/* translators: %s: misc */
|
||||
__( 'The "%s" options group has been removed. Use another settings group.' ),
|
||||
'misc'
|
||||
)
|
||||
@@ -2149,8 +2155,8 @@ function register_setting( $option_group, $option_name, $args = array() ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'3.5.0',
|
||||
/* translators: %s: privacy */
|
||||
sprintf(
|
||||
/* translators: %s: privacy */
|
||||
__( 'The "%s" options group has been removed. Use another settings group.' ),
|
||||
'privacy'
|
||||
)
|
||||
@@ -2189,8 +2195,8 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'3.0.0',
|
||||
/* translators: %s: misc */
|
||||
sprintf(
|
||||
/* translators: %s: misc */
|
||||
__( 'The "%s" options group has been removed. Use another settings group.' ),
|
||||
'misc'
|
||||
)
|
||||
@@ -2202,8 +2208,8 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'3.5.0',
|
||||
/* translators: %s: privacy */
|
||||
sprintf(
|
||||
/* translators: %s: privacy */
|
||||
__( 'The "%s" options group has been removed. Use another settings group.' ),
|
||||
'privacy'
|
||||
)
|
||||
@@ -2219,8 +2225,8 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'4.7.0',
|
||||
/* translators: 1: $sanitize_callback, 2: register_setting() */
|
||||
sprintf(
|
||||
/* translators: 1: $sanitize_callback, 2: register_setting() */
|
||||
__( '%1$s is deprecated. The callback from %2$s is used instead.' ),
|
||||
'<code>$sanitize_callback</code>',
|
||||
'<code>register_setting()</code>'
|
||||
|
||||
@@ -1582,6 +1582,7 @@ if ( ! function_exists( 'wp_notify_postauthor' ) ) :
|
||||
break;
|
||||
}
|
||||
$notify_message .= get_permalink( $comment->comment_post_ID ) . "#comments\r\n\r\n";
|
||||
/* translators: %s: comment URL */
|
||||
$notify_message .= sprintf( __( 'Permalink: %s' ), get_comment_link( $comment ) ) . "\r\n";
|
||||
|
||||
if ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {
|
||||
@@ -1767,8 +1768,8 @@ if ( ! function_exists( 'wp_notify_moderator' ) ) :
|
||||
/* translators: Comment moderation. %s: Comment action URL */
|
||||
$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment_id}#wpbody-content" ) ) . "\r\n";
|
||||
|
||||
/* translators: Comment moderation. %s: Number of comments awaiting approval */
|
||||
$notify_message .= sprintf(
|
||||
/* translators: Comment moderation. %s: Number of comments awaiting approval */
|
||||
_n(
|
||||
'Currently %s comment is waiting for approval. Please visit the moderation panel:',
|
||||
'Currently %s comments are waiting for approval. Please visit the moderation panel:',
|
||||
|
||||
@@ -123,6 +123,9 @@ function get_the_title( $post = 0 ) {
|
||||
if ( ! is_admin() ) {
|
||||
if ( ! empty( $post->post_password ) ) {
|
||||
|
||||
/* translators: %s: protected post title */
|
||||
$prepend = __( 'Protected: %s' );
|
||||
|
||||
/**
|
||||
* Filters the text prepended to the post title for protected posts.
|
||||
*
|
||||
@@ -134,10 +137,13 @@ function get_the_title( $post = 0 ) {
|
||||
* Default 'Protected: %s'.
|
||||
* @param WP_Post $post Current post object.
|
||||
*/
|
||||
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post );
|
||||
$protected_title_format = apply_filters( 'protected_title_format', $prepend, $post );
|
||||
$title = sprintf( $protected_title_format, $title );
|
||||
} elseif ( isset( $post->post_status ) && 'private' == $post->post_status ) {
|
||||
|
||||
/* translators: %s: private post title */
|
||||
$prepend = __( 'Private: %s' );
|
||||
|
||||
/**
|
||||
* Filters the text prepended to the post title of private posts.
|
||||
*
|
||||
@@ -149,7 +155,7 @@ function get_the_title( $post = 0 ) {
|
||||
* Default 'Private: %s'.
|
||||
* @param WP_Post $post Current post object.
|
||||
*/
|
||||
$private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ), $post );
|
||||
$private_title_format = apply_filters( 'private_title_format', $prepend, $post );
|
||||
$title = sprintf( $private_title_format, $title );
|
||||
}
|
||||
}
|
||||
|
||||
+80
-16
@@ -312,7 +312,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Published', 'post status' ),
|
||||
'public' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of published posts */
|
||||
'label_count' => _n_noop(
|
||||
'Published <span class="count">(%s)</span>',
|
||||
'Published <span class="count">(%s)</span>'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -322,7 +326,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Scheduled', 'post status' ),
|
||||
'protected' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of scheduled posts */
|
||||
'label_count' => _n_noop(
|
||||
'Scheduled <span class="count">(%s)</span>',
|
||||
'Scheduled <span class="count">(%s)</span>'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -332,7 +340,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Draft', 'post status' ),
|
||||
'protected' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of draft posts */
|
||||
'label_count' => _n_noop(
|
||||
'Draft <span class="count">(%s)</span>',
|
||||
'Drafts <span class="count">(%s)</span>'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -342,7 +354,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Pending', 'post status' ),
|
||||
'protected' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of pending posts */
|
||||
'label_count' => _n_noop(
|
||||
'Pending <span class="count">(%s)</span>',
|
||||
'Pending <span class="count">(%s)</span>'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -352,7 +368,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Private', 'post status' ),
|
||||
'private' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of private posts */
|
||||
'label_count' => _n_noop(
|
||||
'Private <span class="count">(%s)</span>',
|
||||
'Private <span class="count">(%s)</span>'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -362,7 +382,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Trash', 'post status' ),
|
||||
'internal' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of trashed posts */
|
||||
'label_count' => _n_noop(
|
||||
'Trash <span class="count">(%s)</span>',
|
||||
'Trash <span class="count">(%s)</span>'
|
||||
),
|
||||
'show_in_admin_status_list' => true,
|
||||
)
|
||||
);
|
||||
@@ -392,7 +416,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Pending', 'request status' ),
|
||||
'internal' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of pending requests */
|
||||
'label_count' => _n_noop(
|
||||
'Pending <span class="count">(%s)</span>',
|
||||
'Pending <span class="count">(%s)</span>'
|
||||
),
|
||||
'exclude_from_search' => false,
|
||||
)
|
||||
);
|
||||
@@ -403,7 +431,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Confirmed', 'request status' ),
|
||||
'internal' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of confirmed requests */
|
||||
'label_count' => _n_noop(
|
||||
'Confirmed <span class="count">(%s)</span>',
|
||||
'Confirmed <span class="count">(%s)</span>'
|
||||
),
|
||||
'exclude_from_search' => false,
|
||||
)
|
||||
);
|
||||
@@ -414,7 +446,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Failed', 'request status' ),
|
||||
'internal' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of failed requests */
|
||||
'label_count' => _n_noop(
|
||||
'Failed <span class="count">(%s)</span>',
|
||||
'Failed <span class="count">(%s)</span>'
|
||||
),
|
||||
'exclude_from_search' => false,
|
||||
)
|
||||
);
|
||||
@@ -425,7 +461,11 @@ function create_initial_post_types() {
|
||||
'label' => _x( 'Completed', 'request status' ),
|
||||
'internal' => true,
|
||||
'_builtin' => true, /* internal use only. */
|
||||
'label_count' => _n_noop( 'Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of completed requests */
|
||||
'label_count' => _n_noop(
|
||||
'Completed <span class="count">(%s)</span>',
|
||||
'Completed <span class="count">(%s)</span>'
|
||||
),
|
||||
'exclude_from_search' => false,
|
||||
)
|
||||
);
|
||||
@@ -2650,32 +2690,56 @@ function get_post_mime_types() {
|
||||
'image' => array(
|
||||
__( 'Images' ),
|
||||
__( 'Manage Images' ),
|
||||
_n_noop( 'Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of images */
|
||||
_n_noop(
|
||||
'Image <span class="count">(%s)</span>',
|
||||
'Images <span class="count">(%s)</span>'
|
||||
),
|
||||
),
|
||||
'audio' => array(
|
||||
__( 'Audio' ),
|
||||
__( 'Manage Audio' ),
|
||||
_n_noop( 'Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of audio files */
|
||||
_n_noop(
|
||||
'Audio <span class="count">(%s)</span>',
|
||||
'Audio <span class="count">(%s)</span>'
|
||||
),
|
||||
),
|
||||
'video' => array(
|
||||
__( 'Video' ),
|
||||
__( 'Manage Video' ),
|
||||
_n_noop( 'Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of video files */
|
||||
_n_noop(
|
||||
'Video <span class="count">(%s)</span>',
|
||||
'Video <span class="count">(%s)</span>'
|
||||
),
|
||||
),
|
||||
'document' => array(
|
||||
__( 'Documents' ),
|
||||
__( 'Manage Documents' ),
|
||||
_n_noop( 'Document <span class="count">(%s)</span>', 'Documents <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of documents */
|
||||
_n_noop(
|
||||
'Document <span class="count">(%s)</span>',
|
||||
'Documents <span class="count">(%s)</span>'
|
||||
),
|
||||
),
|
||||
'spreadsheet' => array(
|
||||
__( 'Spreadsheets' ),
|
||||
__( 'Manage Spreadsheets' ),
|
||||
_n_noop( 'Spreadsheet <span class="count">(%s)</span>', 'Spreadsheets <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of spreadsheets */
|
||||
_n_noop(
|
||||
'Spreadsheet <span class="count">(%s)</span>',
|
||||
'Spreadsheets <span class="count">(%s)</span>'
|
||||
),
|
||||
),
|
||||
'archive' => array(
|
||||
__( 'Archives' ),
|
||||
__( 'Manage Archives' ),
|
||||
_n_noop( 'Archive <span class="count">(%s)</span>', 'Archives <span class="count">(%s)</span>' ),
|
||||
/* translators: %s: number of archives */
|
||||
_n_noop(
|
||||
'Archive <span class="count">(%s)</span>',
|
||||
'Archives <span class="count">(%s)</span>'
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -863,7 +863,7 @@ function is_embed() {
|
||||
function is_main_query() {
|
||||
if ( 'pre_get_posts' === current_filter() ) {
|
||||
$message = sprintf(
|
||||
/* translators: 1: pre_get_posts 2: WP_Query->is_main_query() 3: is_main_query() 4: link to codex is_main_query() page. */
|
||||
/* translators: 1: pre_get_posts, 2: WP_Query->is_main_query(), 3: is_main_query(), 4: link to codex is_main_query() page. */
|
||||
__( 'In %1$s, use the %2$s method, not the %3$s function. See %4$s.' ),
|
||||
'<code>pre_get_posts</code>',
|
||||
'<code>WP_Query->is_main_query()</code>',
|
||||
|
||||
@@ -1177,6 +1177,7 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) {
|
||||
}
|
||||
} elseif ( isset( $args['additionalProperties'] ) ) {
|
||||
if ( false === $args['additionalProperties'] ) {
|
||||
/* translators: %s: property of an object */
|
||||
return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not a valid property of Object.' ), $property ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -805,6 +805,7 @@ class WP_REST_Request implements ArrayAccess {
|
||||
if ( $invalid_params ) {
|
||||
return new WP_Error(
|
||||
'rest_invalid_param',
|
||||
/* translators: %s: list of invalid parameters */
|
||||
sprintf( __( 'Invalid parameter(s): %s' ), implode( ', ', array_keys( $invalid_params ) ) ),
|
||||
array(
|
||||
'status' => 400,
|
||||
@@ -850,6 +851,7 @@ class WP_REST_Request implements ArrayAccess {
|
||||
if ( ! empty( $required ) ) {
|
||||
return new WP_Error(
|
||||
'rest_missing_callback_param',
|
||||
/* translators: %s: list of required parameters */
|
||||
sprintf( __( 'Missing parameter(s): %s' ), implode( ', ', $required ) ),
|
||||
array(
|
||||
'status' => 400,
|
||||
@@ -885,6 +887,7 @@ class WP_REST_Request implements ArrayAccess {
|
||||
if ( $invalid_params ) {
|
||||
return new WP_Error(
|
||||
'rest_invalid_param',
|
||||
/* translators: %s: list of invalid parameters */
|
||||
sprintf( __( 'Invalid parameter(s): %s' ), implode( ', ', array_keys( $invalid_params ) ) ),
|
||||
array(
|
||||
'status' => 400,
|
||||
|
||||
@@ -157,7 +157,12 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( ! empty( $forbidden_params ) ) {
|
||||
return new WP_Error( 'rest_forbidden_param', sprintf( __( 'Query parameter not permitted: %s' ), implode( ', ', $forbidden_params ) ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error(
|
||||
'rest_forbidden_param',
|
||||
/* translators: %s: list of forbidden parameters */
|
||||
sprintf( __( 'Query parameter not permitted: %s' ), implode( ', ', $forbidden_params ) ),
|
||||
array( 'status' => rest_authorization_required_code() )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -190,6 +190,7 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
if ( is_wp_error( rest_validate_value_from_schema( get_option( $args['option_name'], false ), $args['schema'] ) ) ) {
|
||||
return new WP_Error(
|
||||
'rest_invalid_stored_value',
|
||||
/* translators: %s: property name */
|
||||
sprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ),
|
||||
array( 'status' => 500 )
|
||||
);
|
||||
|
||||
@@ -1115,6 +1115,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
// Error messages for Plupload.
|
||||
$uploader_l10n = array(
|
||||
'queue_limit_exceeded' => __( 'You have attempted to queue too many files.' ),
|
||||
/* translators: %s: File name */
|
||||
'file_exceeds_size_limit' => __( '%s exceeds the maximum upload size for this site.' ),
|
||||
'zero_byte_file' => __( 'This file is empty. Please try another.' ),
|
||||
'invalid_filetype' => __( 'Sorry, this file type is not permitted for security reasons.' ),
|
||||
@@ -1128,6 +1129,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'upload_failed' => __( 'Upload failed.' ),
|
||||
/* translators: 1: Opening link tag, 2: Closing link tag */
|
||||
'big_upload_failed' => __( 'Please try uploading this file with the %1$sbrowser uploader%2$s.' ),
|
||||
/* translators: %s: File name */
|
||||
'big_upload_queued' => __( '%s exceeds the maximum upload size for the multi-file uploader when used in your browser.' ),
|
||||
'io_error' => __( 'IO error.' ),
|
||||
'security_error' => __( 'Security error.' ),
|
||||
@@ -1136,6 +1138,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'dismiss' => __( 'Dismiss' ),
|
||||
'crunching' => __( 'Crunching…' ),
|
||||
'deleted' => __( 'moved to the trash.' ),
|
||||
/* translators: %s: File name */
|
||||
'error_uploading' => __( '“%s” has failed to upload.' ),
|
||||
);
|
||||
|
||||
@@ -1780,6 +1783,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'unknownError' => __( 'Something went wrong.' ),
|
||||
'connectionError' => __( 'Connection lost or the server is busy. Please try again later.' ),
|
||||
'nonceError' => __( 'An error has occurred. Please reload the page and try again.' ),
|
||||
/* translators: %s: Number of plugins */
|
||||
'pluginsFound' => __( 'Number of plugins found: %d' ),
|
||||
'noPluginsFound' => __( 'No plugins found. Try a different search.' ),
|
||||
),
|
||||
|
||||
@@ -33,11 +33,14 @@ if ( post_password_required() ) { ?>
|
||||
<h3 id="comments">
|
||||
<?php
|
||||
if ( 1 == get_comments_number() ) {
|
||||
/* translators: %s: post title */
|
||||
printf( __( 'One response to %s' ), '“' . get_the_title() . '”' );
|
||||
} else {
|
||||
/* translators: 1: number of comments, 2: post title */
|
||||
printf(
|
||||
/* translators: %s: post title */
|
||||
__( 'One response to %s' ),
|
||||
'“' . get_the_title() . '”'
|
||||
);
|
||||
} else {
|
||||
printf(
|
||||
/* translators: 1: number of comments, 2: post title */
|
||||
_n( '%1$s response to %2$s', '%1$s responses to %2$s', get_comments_number() ),
|
||||
number_format_i18n( get_comments_number() ),
|
||||
'“' . get_the_title() . '”'
|
||||
|
||||
@@ -41,8 +41,8 @@ _deprecated_file(
|
||||
<?php elseif ( is_category() ) : /* If this is a category archive */ ?>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: %s: category name */
|
||||
printf(
|
||||
/* translators: %s: category name */
|
||||
__( 'You are currently browsing the archives for the %s category.' ),
|
||||
single_cat_title( '', false )
|
||||
);
|
||||
@@ -52,8 +52,8 @@ _deprecated_file(
|
||||
<?php elseif ( is_day() ) : /* If this is a daily archive */ ?>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: 1: site link, 2: archive date */
|
||||
printf(
|
||||
/* translators: 1: site link, 2: archive date */
|
||||
__( 'You are currently browsing the %1$s blog archives for the day %2$s.' ),
|
||||
sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
|
||||
get_the_time( __( 'l, F jS, Y' ) )
|
||||
@@ -64,8 +64,8 @@ _deprecated_file(
|
||||
<?php elseif ( is_month() ) : /* If this is a monthly archive */ ?>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: 1: site link, 2: archive month */
|
||||
printf(
|
||||
/* translators: 1: site link, 2: archive month */
|
||||
__( 'You are currently browsing the %1$s blog archives for %2$s.' ),
|
||||
sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
|
||||
get_the_time( __( 'F, Y' ) )
|
||||
@@ -76,8 +76,8 @@ _deprecated_file(
|
||||
<?php elseif ( is_year() ) : /* If this is a yearly archive */ ?>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: 1: site link, 2: archive year */
|
||||
printf(
|
||||
/* translators: 1: site link, 2: archive year */
|
||||
__( 'You are currently browsing the %1$s blog archives for the year %2$s.' ),
|
||||
sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
|
||||
get_the_time( 'Y' )
|
||||
@@ -88,8 +88,8 @@ _deprecated_file(
|
||||
<?php elseif ( is_search() ) : /* If this is a search result */ ?>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: 1: site link, 2: search query */
|
||||
printf(
|
||||
/* translators: 1: site link, 2: search query */
|
||||
__( 'You have searched the %1$s blog archives for <strong>‘%2$s’</strong>. If you are unable to find anything in these search results, you can try one of these links.' ),
|
||||
sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
|
||||
esc_html( get_search_query() )
|
||||
@@ -100,8 +100,8 @@ _deprecated_file(
|
||||
<?php elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) : /* If this set is paginated */ ?>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: %s: site link */
|
||||
printf(
|
||||
/* translators: %s: site link */
|
||||
__( 'You are currently browsing the %s blog archives.' ),
|
||||
sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) )
|
||||
);
|
||||
|
||||
@@ -2564,10 +2564,10 @@ function add_theme_support( $feature, ...$args ) {
|
||||
case 'title-tag':
|
||||
// Can be called in functions.php but must happen before wp_loaded, i.e. not in header.php.
|
||||
if ( did_action( 'wp_loaded' ) ) {
|
||||
/* translators: 1: title-tag, 2: wp_loaded */
|
||||
_doing_it_wrong(
|
||||
"add_theme_support( 'title-tag' )",
|
||||
sprintf(
|
||||
/* translators: 1: title-tag, 2: wp_loaded */
|
||||
__( 'Theme support for %1$s should be registered before the %2$s hook.' ),
|
||||
'<code>title-tag</code>',
|
||||
'<code>wp_loaded</code>'
|
||||
|
||||
@@ -2557,7 +2557,14 @@ function register_new_user( $user_login, $user_email ) {
|
||||
$user_pass = wp_generate_password( 12, false );
|
||||
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
|
||||
if ( ! $user_id || is_wp_error( $user_id ) ) {
|
||||
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
|
||||
$errors->add(
|
||||
'registerfail',
|
||||
sprintf(
|
||||
/* translators: %s: admin email address */
|
||||
__( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ),
|
||||
get_option( 'admin_email' )
|
||||
)
|
||||
);
|
||||
return $errors;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,12 @@ function register_sidebars( $number = 1, $args = array() ) {
|
||||
$_args = $args;
|
||||
|
||||
if ( $number > 1 ) {
|
||||
$_args['name'] = isset( $args['name'] ) ? sprintf( $args['name'], $i ) : sprintf( __( 'Sidebar %d' ), $i );
|
||||
if ( isset( $args['name'] ) ) {
|
||||
$_args['name'] = sprintf( $args['name'], $i );
|
||||
} else {
|
||||
/* translators: %d: Sidebar number */
|
||||
$_args['name'] = sprintf( __( 'Sidebar %d' ), $i );
|
||||
}
|
||||
} else {
|
||||
$_args['name'] = isset( $args['name'] ) ? $args['name'] : __( 'Sidebar' );
|
||||
}
|
||||
@@ -247,6 +252,7 @@ function register_sidebar( $args = array() ) {
|
||||
$id_is_empty = empty( $args['id'] );
|
||||
|
||||
$defaults = array(
|
||||
/* translators: %d: Sidebar number */
|
||||
'name' => sprintf( __( 'Sidebar %d' ), $i ),
|
||||
'id' => "sidebar-$i",
|
||||
'description' => '',
|
||||
@@ -260,8 +266,17 @@ function register_sidebar( $args = array() ) {
|
||||
$sidebar = wp_parse_args( $args, $defaults );
|
||||
|
||||
if ( $id_is_empty ) {
|
||||
/* translators: 1: the id argument, 2: sidebar name, 3: recommended id value */
|
||||
_doing_it_wrong( __FUNCTION__, sprintf( __( 'No %1$s was set in the arguments array for the "%2$s" sidebar. Defaulting to "%3$s". Manually set the %1$s to "%3$s" to silence this notice and keep existing sidebar content.' ), '<code>id</code>', $sidebar['name'], $sidebar['id'] ), '4.2.0' );
|
||||
_doing_it_wrong(
|
||||
__FUNCTION__,
|
||||
sprintf(
|
||||
/* translators: 1: the id argument, 2: sidebar name, 3: recommended id value */
|
||||
__( 'No %1$s was set in the arguments array for the "%2$s" sidebar. Defaulting to "%3$s". Manually set the %1$s to "%3$s" to silence this notice and keep existing sidebar content.' ),
|
||||
'<code>id</code>',
|
||||
$sidebar['name'],
|
||||
$sidebar['id']
|
||||
),
|
||||
'4.2.0'
|
||||
);
|
||||
}
|
||||
|
||||
$wp_registered_sidebars[ $sidebar['id'] ] = $sidebar;
|
||||
@@ -1104,8 +1119,15 @@ function the_widget( $widget, $instance = array(), $args = array() ) {
|
||||
global $wp_widget_factory;
|
||||
|
||||
if ( ! isset( $wp_widget_factory->widgets[ $widget ] ) ) {
|
||||
/* translators: %s: register_widget() */
|
||||
_doing_it_wrong( __FUNCTION__, sprintf( __( 'Widgets need to be registered using %s, before they can be displayed.' ), '<code>register_widget()</code>' ), '4.9.0' );
|
||||
_doing_it_wrong(
|
||||
__FUNCTION__,
|
||||
sprintf(
|
||||
/* translators: %s: register_widget() */
|
||||
__( 'Widgets need to be registered using %s, before they can be displayed.' ),
|
||||
'<code>register_widget()</code>'
|
||||
),
|
||||
'4.9.0'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,8 +142,10 @@ class WP_Nav_Menu_Widget extends WP_Widget {
|
||||
} else {
|
||||
$url = admin_url( 'nav-menus.php' );
|
||||
}
|
||||
|
||||
/* translators: %s: URL to create a new menu */
|
||||
printf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) );
|
||||
?>
|
||||
<?php echo sprintf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) ); ?>
|
||||
</p>
|
||||
<div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>>
|
||||
<p>
|
||||
|
||||
@@ -120,8 +120,8 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
||||
|
||||
foreach ( (array) $comments as $comment ) {
|
||||
$output .= '<li class="recentcomments">';
|
||||
/* translators: comments widget: 1: comment author, 2: post link */
|
||||
$output .= sprintf(
|
||||
/* translators: comments widget: 1: comment author, 2: post link */
|
||||
_x( '%1$s on %2$s', 'widgets' ),
|
||||
'<span class="comment-author-link">' . get_comment_author_link( $comment ) . '</span>',
|
||||
'<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
|
||||
|
||||
@@ -1307,7 +1307,15 @@ class wpdb {
|
||||
// This is not meant to be foolproof -- but it will catch obviously incorrect usage.
|
||||
if ( strpos( $query, '%' ) === false ) {
|
||||
wp_load_translations_early();
|
||||
_doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s must have a placeholder.' ), 'wpdb::prepare()' ), '3.9.0' );
|
||||
_doing_it_wrong(
|
||||
'wpdb::prepare',
|
||||
sprintf(
|
||||
/* translators: %s: wpdb::prepare() */
|
||||
__( 'The query argument of %s must have a placeholder.' ),
|
||||
'wpdb::prepare()'
|
||||
),
|
||||
'3.9.0'
|
||||
);
|
||||
}
|
||||
|
||||
// If args were passed as an array (as in vsprintf), move them up.
|
||||
@@ -1320,7 +1328,15 @@ class wpdb {
|
||||
foreach ( $args as $arg ) {
|
||||
if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) {
|
||||
wp_load_translations_early();
|
||||
_doing_it_wrong( 'wpdb::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' );
|
||||
_doing_it_wrong(
|
||||
'wpdb::prepare',
|
||||
sprintf(
|
||||
/* translators: %s: value type */
|
||||
__( 'Unsupported value type (%s).' ),
|
||||
gettype( $arg )
|
||||
),
|
||||
'4.8.2'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1357,7 +1373,11 @@ class wpdb {
|
||||
if ( 1 === $placeholders && $passed_as_array ) {
|
||||
// If the passed query only expected one argument, but the wrong number of arguments were sent as an array, bail.
|
||||
wp_load_translations_early();
|
||||
_doing_it_wrong( 'wpdb::prepare', __( 'The query only expected one placeholder, but an array of multiple placeholders was sent.' ), '4.9.0' );
|
||||
_doing_it_wrong(
|
||||
'wpdb::prepare',
|
||||
__( 'The query only expected one placeholder, but an array of multiple placeholders was sent.' ),
|
||||
'4.9.0'
|
||||
);
|
||||
|
||||
return;
|
||||
} else {
|
||||
@@ -1368,8 +1388,8 @@ class wpdb {
|
||||
wp_load_translations_early();
|
||||
_doing_it_wrong(
|
||||
'wpdb::prepare',
|
||||
/* translators: 1: number of placeholders, 2: number of arguments passed */
|
||||
sprintf(
|
||||
/* translators: 1: number of placeholders, 2: number of arguments passed */
|
||||
__( 'The query does not contain the correct number of placeholders (%1$d) for the number of arguments passed (%2$d).' ),
|
||||
$placeholders,
|
||||
count( $args )
|
||||
|
||||
Reference in New Issue
Block a user