Changes between Initial Version and Version 1 of Ticket #59847, comment 13
- Timestamp:
- 11/08/2023 10:32:18 PM (15 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #59847, comment 13
initial v1 1 1 @joemcgill It doesn't appear that resetting the globals would help. It seems that calls to `get_stylesheet_directory()` return an invalid path if called before a certain point (when the theme is setup perhaps). 2 2 3 So, when ACF calls it during it 's setup (`plugins_loaded` or similar), `get_stylesheet_directory()` returns the default theme path (`wp-content/themes/whatever`), but any call to that function during `after_setup_theme` returns the correct path (`custom-directory/whatever`).3 So, when ACF calls it during its setup (`plugins_loaded` or similar), `get_stylesheet_directory()` returns the default theme path (`wp-content/themes/whatever`), but any call to that function during `after_setup_theme` returns the correct path (`custom-directory/whatever`). 4 4 5 5 So this could be the fault of ACF calling the function too early (I've opened a ticket with them to investigate), but there is no mention of this being an issue on the [https://developer.wordpress.org/reference/functions/get_stylesheet_directory/ docs page]. Or, WordPress should be handling this better and not returning an invalid path.