[wp-trac] [WordPress Trac] #57371: Twenty Twenty: Remove Unused function parameter and variable.

WordPress Trac noreply at wordpress.org
Fri Jun 23 03:52:12 UTC 2023


#57371: Twenty Twenty: Remove Unused function parameter and variable.
-----------------------------------------+-------------------------------
 Reporter:  upadalavipul                 |       Owner:  (none)
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  6.3
Component:  Bundled Theme                |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:  coding-standards
-----------------------------------------+-------------------------------

Comment (by mukesh27):

 Replying to [comment:2 sabernhardt]:
 > The global `$post` variable should stay. According to the
 [https://developer.wordpress.org/reference/functions/setup_postdata/
 setup_postdata documentation], "`setup_postdata()` does **not** assign the
 global `$post` variable so it’s important that you do this yourself."

 I argue that if we already pass the post ID to the `setup_postdata`
 function, then why do we need to use the global variable?

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


More information about the wp-trac mailing list