Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #59000, comment 28


Ignore:
Timestamp:
09/11/2023 08:57:54 PM (10 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59000, comment 28

    initial v1  
    77I'm actually starting to have some "second thoughts" about this (yea, I know it was my idea, sorry). Looking at how `get_stylesheet()` is used in core, it's mostly to check the (active) theme, not to actually get the path/URI to load the theme assets. It only returns the (filtered) option from the options table, nothing else. Seems it should be possible to do that at any time.
    88
    9 The problem in this ticket doesn't seem to be that the `stylesheet` and `template` filters may be called too early, but that it is likely they are not the best filters for `wp_get_theme_preview_path()` (previewing changes/edits to the theme should not be changing what the active theme is, right?).
     9The problem in this ticket doesn't seem to be that the `stylesheet` and `template` filters may be called too early, but that it is likely they are not the best filters for `wp_get_theme_preview_path()`. Previewing changes/edits to the theme should not be changing what the active theme is, right? Seems `get_stylesheet()` is used to identify the active theme.
    1010
    1111Thinking that the current patch: attaching the filters late (on plugins_loaded) seems like an okay solution, for now. Ideally the way `wp_get_theme_preview_path()` is implemented can be improved so it uses different filters/hooks.