Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #59847, comment 8


Ignore:
Timestamp:
11/08/2023 09:55:37 PM (9 months ago)
Author:
coreyw
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59847, comment 8

    initial v1  
    11@partyfrikadelle good work. You're right, WP core does not call `get_stylesheet_directory()` that early by default. In my case, we are including Advanced Custom Fields as a "must-use" plugin, and it calls that function first, before our custom theme directory is registered. A "simple" solution is to make our plugin load first (must-use are loaded in alphabetical order far as I know). Since there is a workaround I'm not sure if there needs to be any fix applied, but it should be documented that calls to `register_theme_directory()` should be prioritized.
     2
     3Edit: in my case I also need to add `add_filter('theme_root', fn (string $value): string => $value);` while registering the custom directory for it to work.