[wp-trac] [WordPress Trac] #59105: `blocks/footnotes.php` file overwrites global `$post_type` variable

WordPress Trac noreply at wordpress.org
Tue Aug 15 06:03:27 UTC 2023


#59105: `blocks/footnotes.php` file overwrites global `$post_type` variable
-------------------------------+-----------------------------
 Reporter:  om4csaba           |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  6.3
 Severity:  major              |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 The `blocks/footnotes.php` file in v 6.3 introduced a name collision with
 the global `$post_type` variable.

 This name collision occurred because the `blocks/footnotes.php` file is
 not loaded within a function or method.

 Now, WordPress sets the global variable in every context, such as the REST
 API, where this variable previously did not exist. As a result, any plugin
 or theme that relies on the global `$post_type` variable may experience a
 change in behavior.

 See the impact on WooCommerce here:
 https://github.com/woocommerce/woocommerce/issues/39744

 Changes introduced: [56298]
 Related ticket: #58804

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


More information about the wp-trac mailing list