Make WordPress Core

Changes between Version 6 and Version 7 of Ticket #59000, comment 13


Ignore:
Timestamp:
08/25/2023 10:51:48 PM (3 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59000, comment 13

    v6 v7  
    22
    33Also there is some [https://core.trac.wordpress.org/browser/tags/6.3/src/wp-includes/theme-previews.php#L78 "loose" code in theme-previews.php] that should probably not be there. Adding of actions and filters should be in `default-filters.php` unless there is a need for a (well documented) exception.
     4
     5Looking at the [https://github.com/WordPress/gutenberg/issues/53284 original issue], it seems better to warn plugin authors that methods like `$wp_theme->get_stylesheet()` cannot be used before the `plugins_loaded` action (which runs immediately after all plugins and pluggable.php are loaded). Then add a "doing it wrong" in these methods similarly to the way in script-loader.php (i.e. check if the `plugins_loaded` action has run and can doing_it_wrong if not). This will also ensure similar errors do not happen in the future.