Make WordPress Core

Changeset 49356


Ignore:
Timestamp:
10/28/2020 05:07:18 PM (4 years ago)
Author:
SergeyBiryukov
Message:

General: Ensure that filtered arguments in get_search_form() contain all required default values.

Props kellybleck, davidbaumwald, whyisjake, SergeyBiryukov.
Merges [49355] to the 5.5 branch.
Fixes #51645.

Location:
branches/5.5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

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

    r48922 r49356  
    24812481    $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
    24822482
    2483     // Ensure that the filtered args contain all required default values.
     2483    // Ensure that the filtered arguments contain all required default values.
    24842484    $args = array_merge( $defaults, $args );
    24852485
  • branches/5.5/src/wp-includes/general-template.php

    r48922 r49356  
    282282    $args = apply_filters( 'search_form_args', $args );
    283283
     284    // Ensure that the filtered arguments contain all required default values.
     285    $args = array_merge( $defaults, $args );
     286
    284287    $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
    285288
     
    304307    } else {
    305308        // Build a string containing an aria-label to use for the search form.
    306         if ( isset( $args['aria_label'] ) && $args['aria_label'] ) {
     309        if ( $args['aria_label'] ) {
    307310            $aria_label = 'aria-label="' . esc_attr( $args['aria_label'] ) . '" ';
    308311        } else {
Note: See TracChangeset for help on using the changeset viewer.