[wp-trac] [WordPress Trac] #43521: Excluded terms filter in get_adjacent_post is not executed if excluded_terms parameter is empty

WordPress Trac noreply at wordpress.org
Sun Mar 11 10:27:49 UTC 2018


#43521: Excluded terms filter in get_adjacent_post is not executed if
excluded_terms parameter is empty
--------------------------+-----------------------------
 Reporter:  zottto        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.9.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The filter {{{get_previous_post_excluded_terms}}} /
 {{{get_next_post_excluded_terms}}} is only executed if the parameter
 {{{$excluded_terms}}} of {{{get_adjacent_post}}} (resp.
 {{{get_previous_post}}} / {{{get_next_post}}}) is set.
 If {{{$exclued_terms}}} is not set (e.g. because the parameter is
 optional) it is not possible to change the list of excluded terms.

 Expected behaviour: The filter should also be executed with an empty
 {{{$exclided_terms}}} list to be able to add terms to this list.

 The {{{apply_filter}}} is called within a condition {{{if ( $in_same_term
 || ! empty( $excluded_terms ) )}}} which is not met if the parameter is
 empty.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43521>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list