Changes between Initial Version and Version 1 of Ticket #18408, comment 33
- Timestamp:
- 02/26/2021 09:29:51 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18408, comment 33
initial v1 3 3 I've recently discovered, however, that it is not just the WordPress admin that is affected by the call. If completely ordinary theme code runs a custom loop and calls, for example, `the_excerpt` (which is empty, and thus processes the full content in order to generate an automatic one), the `$post` variable is also broken as it is reset to the incorrect value. 4 4 5 Is the true situation here that there is no admin bug at all - and indeed it is *incorrect* for any shortcode or dynamic blockto use `wp_reset_postdata` in the first place? (With the solution by eg Bill Erickson - save the `$post` variable and restore it afterwards - the correct coding method?)5 Is the true situation here that there is no admin bug at all - and indeed it is *incorrect* for any shortcode, dynamic block, or custom code in the admin, to use `wp_reset_postdata` in the first place? (With the solution by eg Bill Erickson - save the `$post` variable and restore it afterwards - the correct coding method?)