From c7d610fb02266c9d9b832a54ccd89b32e1fc13d5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 11 Dec 2019 22:16:03 +0000 Subject: [PATCH] Comments: Avoid a PHP notice in `comment_form()` if the `email` field is not set. Follow-up to [46090]. Props mat-lipe. Merges [46885] to the 5.3 branch. Fixes #48943. Built from https://develop.svn.wordpress.org/branches/5.3@46886 git-svn-id: http://core.svn.wordpress.org/branches/5.3@46686 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 9f945a9e3e..d142ffac3a 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -2433,7 +2433,7 @@ function comment_form( $args = array(), $post_id = null ) { $args = array_merge( $defaults, $args ); // Remove aria-describedby from the email field if there's no associated description. - if ( false === strpos( $args['comment_notes_before'], 'id="email-notes"' ) ) { + if ( isset( $args['fields']['email'] ) && false === strpos( $args['comment_notes_before'], 'id="email-notes"' ) ) { $args['fields']['email'] = str_replace( ' aria-describedby="email-notes"', '', diff --git a/wp-includes/version.php b/wp-includes/version.php index c5fb45c846..6c70ff90d2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3.1-RC1-46884'; +$wp_version = '5.3.1-RC1-46886'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.