diff --git a/wp-content/themes/twentyeleven/content-single.php b/wp-content/themes/twentyeleven/content-single.php
index 8969701b86..55e3e50559 100644
--- a/wp-content/themes/twentyeleven/content-single.php
+++ b/wp-content/themes/twentyeleven/content-single.php
@@ -66,7 +66,8 @@
diff --git a/wp-content/themes/twentyten/author.php b/wp-content/themes/twentyten/author.php
index 52996ca0d6..8383d24d18 100644
--- a/wp-content/themes/twentyten/author.php
+++ b/wp-content/themes/twentyten/author.php
@@ -47,7 +47,8 @@ if ( get_the_author_meta( 'description' ) ) :
*
* @param int The height and width avatar dimensions in pixels. Default 60.
*/
- echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) );
+ $author_bio_avatar_size = apply_filters( 'twentyten_author_bio_avatar_size', 60 );
+ echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
?>
diff --git a/wp-content/themes/twentyten/loop-single.php b/wp-content/themes/twentyten/loop-single.php
index 8cf51ae475..4ae519be81 100644
--- a/wp-content/themes/twentyten/loop-single.php
+++ b/wp-content/themes/twentyten/loop-single.php
@@ -50,7 +50,8 @@ if ( have_posts() ) {
diff --git a/wp-includes/class-walker-category.php b/wp-includes/class-walker-category.php
index 19ccda56ef..e5fff0e6da 100644
--- a/wp-includes/class-walker-category.php
+++ b/wp-includes/class-walker-category.php
@@ -97,11 +97,7 @@ class Walker_Category extends Walker {
*/
public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
/** This filter is documented in wp-includes/category-template.php */
- $cat_name = apply_filters(
- 'list_cats',
- esc_attr( $category->name ),
- $category
- );
+ $cat_name = apply_filters( 'list_cats', esc_attr( $category->name ), $category );
// Don't generate an element if the category name is empty.
if ( '' === $cat_name ) {
diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php
index aef93c2f04..eb5ee112fb 100644
--- a/wp-includes/class-wp-image-editor-imagick.php
+++ b/wp-includes/class-wp-image-editor-imagick.php
@@ -665,9 +665,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
$perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executable bits
chmod( $filename, $perms );
- /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */
return array(
'path' => $filename,
+ /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
'width' => $this->size['width'],
'height' => $this->size['height'],
diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php
index f8bdd830dd..2d31717866 100644
--- a/wp-includes/class.wp-styles.php
+++ b/wp-includes/class.wp-styles.php
@@ -199,6 +199,8 @@ class WP_Styles extends WP_Dependencies {
$rel = isset( $obj->extra['alt'] ) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
$title = isset( $obj->extra['title'] ) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : '';
+ $tag = "
\n";
+
/**
* Filters the HTML link tag of an enqueued style.
*
@@ -211,7 +213,7 @@ class WP_Styles extends WP_Dependencies {
* @param string $href The stylesheet's source URL.
* @param string $media The stylesheet's media attribute.
*/
- $tag = apply_filters( 'style_loader_tag', "
\n", $handle, $href, $media );
+ $tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media );
if ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) {
if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
@@ -221,8 +223,9 @@ class WP_Styles extends WP_Dependencies {
$rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" );
}
+ $rtl_tag = "
\n";
/** This filter is documented in wp-includes/class.wp-styles.php */
- $rtl_tag = apply_filters( 'style_loader_tag', "
\n", $handle, $rtl_href, $media );
+ $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media );
if ( $obj->extra['rtl'] === 'replace' ) {
$tag = $rtl_tag;
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index a792b67e91..766548f6a0 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -2274,19 +2274,63 @@ function comment_form( $args = array(), $post_id = null ) {
$req = get_option( 'require_name_email' );
$html_req = ( $req ? " required='required'" : '' );
$html5 = 'html5' === $args['format'];
- $fields = array(
- 'author' => '',
- 'email' => '',
- 'url' => '',
+
+ $fields = array(
+ 'author' => sprintf(
+ '',
+ sprintf(
+ '
',
+ __( 'Name' ),
+ ( $req ? '
*' : '' )
+ ),
+ sprintf(
+ '
',
+ esc_attr( $commenter['comment_author'] ),
+ $html_req
+ )
+ ),
+ 'email' => sprintf(
+ '',
+ sprintf(
+ '
',
+ __( 'Email' ),
+ ( $req ? '
*' : '' )
+ ),
+ sprintf(
+ '
',
+ ( $html5 ? 'type="email"' : 'type="text"' ),
+ esc_attr( $commenter['comment_author_email'] ),
+ $html_req
+ )
+ ),
+ 'url' => sprintf(
+ '',
+ sprintf(
+ '
',
+ __( 'Website' )
+ ),
+ sprintf(
+ '
',
+ ( $html5 ? 'type="url"' : 'type="text"' ),
+ esc_attr( $commenter['comment_author_url'] )
+ )
+ ),
);
if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) && get_option( 'show_comments_cookies_opt_in' ) ) {
- $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
- $fields['cookies'] = '';
+ $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
+
+ $fields['cookies'] = sprintf(
+ '',
+ sprintf(
+ '',
+ $consent
+ ),
+ sprintf(
+ '
',
+ __( 'Save my name, email, and website in this browser for the next time I comment.' )
+ )
+ );
// Ensure that the passed fields include cookies consent.
if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) {
@@ -2307,27 +2351,48 @@ function comment_form( $args = array(), $post_id = null ) {
*
* @param string[] $fields Array of the default comment fields.
*/
- $fields = apply_filters( 'comment_form_default_fields', $fields );
+ $fields = apply_filters( 'comment_form_default_fields', $fields );
+
$defaults = array(
'fields' => $fields,
- 'comment_field' => '',
- /** This filter is documented in wp-includes/link-template.php */
- 'must_log_in' => '
' . sprintf(
- /* translators: %s: Login URL. */
- __( 'You must be logged in to post a comment.' ),
- wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
- ) . '
',
- /** This filter is documented in wp-includes/link-template.php */
- 'logged_in_as' => '
' . sprintf(
- /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */
- __( 'Logged in as %3$s. Log out?' ),
- get_edit_user_link(),
- /* translators: %s: User name. */
- 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 ) )
- ) . '
',
- 'comment_notes_before' => '',
+ 'comment_field' => sprintf(
+ '',
+ sprintf(
+ '
',
+ _x( 'Comment', 'noun' )
+ ),
+ ''
+ ),
+ 'must_log_in' => sprintf(
+ '
%s
',
+ sprintf(
+ /* translators: %s: Login URL. */
+ __( 'You must be
logged in to post a comment.' ),
+ /** This filter is documented in wp-includes/link-template.php */
+ wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
+ )
+ ),
+ 'logged_in_as' => sprintf(
+ '
%s
',
+ sprintf(
+ /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */
+ __( '
Logged in as %3$s.
Log out?' ),
+ get_edit_user_link(),
+ /* translators: %s: User name. */
+ esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
+ $user_identity,
+ /** This filter is documented in wp-includes/link-template.php */
+ wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
+ )
+ ),
+ 'comment_notes_before' => sprintf(
+ '',
+ sprintf(
+ '
%s',
+ __( 'Your email address will not be published.' )
+ ),
+ ( $req ? $required_text : '' )
+ ),
'comment_notes_after' => '',
'action' => site_url( '/wp-comments-post.php' ),
'id_form' => 'commentform',
@@ -2385,6 +2450,7 @@ function comment_form( $args = array(), $post_id = null ) {
echo $args['title_reply_after'];
if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) :
+
echo $args['must_log_in'];
/**
* Fires after the HTML-formatted 'must log in after' message in the comment form.
@@ -2392,165 +2458,175 @@ function comment_form( $args = array(), $post_id = null ) {
* @since 3.0.0
*/
do_action( 'comment_form_must_log_in_after' );
+
else :
- ?>
-
tag.
- *
- * @since 1.5.0
- *
- * @param int $post_id The post ID.
- */
- do_action( 'comment_form', $post_id );
- ?>
-
-
+ /**
+ * Fires at the bottom of the comment form, inside the closing tag.
+ *
+ * @since 1.5.0
+ *
+ * @param int $post_id The post ID.
+ */
+ do_action( 'comment_form', $post_id );
+
+ echo '';
+
+ endif;
+ ?>
' . $args['prev_text'] . '';
+ $page_links[] = sprintf(
+ '
%s',
+ /**
+ * Filters the paginated links for the given archive pages.
+ *
+ * @since 3.0.0
+ *
+ * @param string $link The paginated link URL.
+ */
+ esc_url( apply_filters( 'paginate_links', $link ) ),
+ $args['prev_text']
+ );
endif;
+
for ( $n = 1; $n <= $total; $n++ ) :
if ( $n == $current ) :
- $page_links[] = "
" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '';
+ $page_links[] = sprintf(
+ '
%s',
+ esc_attr( $args['aria_current'] ),
+ $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number']
+ );
$dots = true;
else :
if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
@@ -4077,8 +4087,12 @@ function paginate_links( $args = '' ) {
}
$link .= $args['add_fragment'];
- /** This filter is documented in wp-includes/general-template.php */
- $page_links[] = "
" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '';
+ $page_links[] = sprintf(
+ '
%s',
+ /** This filter is documented in wp-includes/general-template.php */
+ esc_url( apply_filters( 'paginate_links', $link ) ),
+ $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number']
+ );
$dots = true;
elseif ( $dots && ! $args['show_all'] ) :
$page_links[] = '
' . __( '…' ) . '';
@@ -4086,6 +4100,7 @@ function paginate_links( $args = '' ) {
endif;
endif;
endfor;
+
if ( $args['prev_next'] && $current && $current < $total ) :
$link = str_replace( '%_%', $args['format'], $args['base'] );
$link = str_replace( '%#%', $current + 1, $link );
@@ -4094,9 +4109,14 @@ function paginate_links( $args = '' ) {
}
$link .= $args['add_fragment'];
- /** This filter is documented in wp-includes/general-template.php */
- $page_links[] = '
' . $args['next_text'] . '';
+ $page_links[] = sprintf(
+ '
%s',
+ /** This filter is documented in wp-includes/general-template.php */
+ esc_url( apply_filters( 'paginate_links', $link ) ),
+ $args['next_text']
+ );
endif;
+
switch ( $args['type'] ) {
case 'array':
return $page_links;
@@ -4111,6 +4131,7 @@ function paginate_links( $args = '' ) {
$r = join( "\n", $page_links );
break;
}
+
return $r;
}
@@ -4322,18 +4343,25 @@ function wp_admin_css_uri( $file = 'wp-admin' ) {
* @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
*/
function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
- // For backward compatibility
+ // For backward compatibility.
$handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
if ( wp_styles()->query( $handle ) ) {
- if ( $force_echo || did_action( 'wp_print_styles' ) ) { // we already printed the style queue. Print this one immediately
+ if ( $force_echo || did_action( 'wp_print_styles' ) ) {
+ // We already printed the style queue. Print this one immediately.
wp_print_styles( $handle );
- } else { // Add to style queue
+ } else {
+ // Add to style queue.
wp_enqueue_style( $handle );
}
return;
}
+ $stylesheet_link = sprintf(
+ "
\n",
+ esc_url( wp_admin_css_uri( $file ) )
+ );
+
/**
* Filters the stylesheet link to the specified CSS file.
*
@@ -4345,11 +4373,16 @@ function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
* @param string $file Style handle name or filename (without ".css" extension)
* relative to wp-admin/. Defaults to 'wp-admin'.
*/
- echo apply_filters( 'wp_admin_css', "
\n", $file );
+ echo apply_filters( 'wp_admin_css', $stylesheet_link, $file );
if ( function_exists( 'is_rtl' ) && is_rtl() ) {
+ $rtl_stylesheet_link = sprintf(
+ "
\n",
+ esc_url( wp_admin_css_uri( "$file-rtl" ) )
+ );
+
/** This filter is documented in wp-includes/general-template.php */
- echo apply_filters( 'wp_admin_css', "
\n", "$file-rtl" );
+ echo apply_filters( 'wp_admin_css', $rtl_stylesheet_link, "$file-rtl" );
}
}
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php
index 0d015519d3..7b2e4b223c 100644
--- a/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php
+++ b/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php
@@ -358,9 +358,7 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
return new WP_Error( 'rest_autosave_no_changes', __( 'There is nothing to save. The autosave and the post content are the same.' ), array( 'status' => 400 ) );
}
- /**
- * This filter is documented in wp-admin/post.php.
- */
+ /** This filter is documented in wp-admin/post.php */
do_action( 'wp_creating_autosave', $new_autosave );
// wp_update_post expects escaped array.
diff --git a/wp-includes/user.php b/wp-includes/user.php
index d428590668..69b8c35208 100644
--- a/wp-includes/user.php
+++ b/wp-includes/user.php
@@ -2503,8 +2503,8 @@ function register_new_user( $user_login, $user_email ) {
} else {
/** This filter is documented in wp-includes/user.php */
- $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) );
- if ( in_array( strtolower( $sanitized_user_login ), $illegal_user_logins ) ) {
+ $illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() );
+ if ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ) ) ) {
$errors->add( 'invalid_username', __( '
ERROR: Sorry, that username is not allowed.' ) );
}
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index a2b063d399..58c00e4d5f 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.3-alpha-46087';
+$wp_version = '5.3-alpha-46088';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.