Make WordPress Core

Changeset 46885


Ignore:
Timestamp:
12/11/2019 10:12:09 PM (5 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.
Fixes #48943.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r46821 r46885  
    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.