[wp-trac] [WordPress Trac] #48626: Twenty Twenty: Remove unused function argument

WordPress Trac noreply at wordpress.org
Thu Nov 14 11:26:40 UTC 2019


#48626: Twenty Twenty: Remove unused function argument
---------------------------+------------------------------
 Reporter:  manikmist09    |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:  5.3
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  template
---------------------------+------------------------------

Comment (by williampatton):

 Replying to [comment:1 nielslange]:
 > @manikmist09 The Twenty Twenty theme uses the filter `add_filter(
 'edit_post_link', 'twentytwenty_edit_post_link', 10, 3 );`. Removing
 `$text` from `twentytwenty_edit_post_link( $link, $post_id, $text )` would
 lead to the fact that only the translation can be controlled but not the
 logic, in case a developer wants to allow additional HTML elements and/or
 attributes.
 >
 > @Anlino and @williampatton Please correct me if I'm wrong.

 This is correct, it is passed so that the it matches the signature of the
 `apply_filters` call here:
 https://core.trac.wordpress.org/browser/tags/5.3/src/wp-includes/link-
 template.php#L1395

 There are alternative ways to handle this if we were to not pass this
 however I prefer we stay on the side of not adjusting any signatures at
 this point, especially when they are 1:1 matches with the caller. I am
 inclined to add a `wontfix` here but will wait to see if others have
 different thoughts.

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


More information about the wp-trac mailing list