Make WordPress Core


Ignore:
Timestamp:
12/11/2019 10:13:33 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

  • branches/5.3/src/wp-includes/comment-template.php

    r46391 r46886  
    24342434
    24352435    // Remove aria-describedby from the email field if there's no associated description.
    2436     if ( false === strpos( $args['comment_notes_before'], 'id="email-notes"' ) ) {
     2436    if ( isset( $args['fields']['email'] ) && false === strpos( $args['comment_notes_before'], 'id="email-notes"' ) ) {
    24372437        $args['fields']['email'] = str_replace(
    24382438            ' aria-describedby="email-notes"',
Note: See TracChangeset for help on using the changeset viewer.