[wp-trac] [WordPress Trac] #51645: Undefined index: echo in core files

WordPress Trac noreply at wordpress.org
Tue Oct 27 17:03:32 UTC 2020


#51645: Undefined index: echo in core files
------------------------------------+-----------------------------
 Reporter:  kellybleck              |       Owner:  SergeyBiryukov
     Type:  defect (bug)            |      Status:  reviewing
 Priority:  normal                  |   Milestone:  5.5.2
Component:  General                 |     Version:  5.2
 Severity:  trivial                 |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  template
------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 I think a better fix here would be to ensure that all the default values
 are always set:
 {{{
 $args = wp_parse_args( $args, apply_filters( 'search_form_args', $defaults
 ) );
 }}}

 That way we don't have to check whether each individual argument exists.

 The same approach is used in `comment_form()`, `wp_login_form()`, and
 `register_sidebar()`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51645#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list