Automattic / Automattic/page-optimize
apply_filters( 'script_loader_tag' ) does not fire
- Dominant language
- PHP
- Stars
- 35
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
In concat-js.php, in `do_items()`, you have this check:
```
if ( is_array( $js_array['handles'] ) && count( $js_array['handles'] ) === 1 ) {
```
This condition never seems to be true, and the filter never fires.
When I am logged in, handles contains four items:
```
array (
0 => 'hoverintent-js',
1 => 'admin-bar',
2 => 'main',
3 => 'wp-embed',
)
```
When I am not logged in, handles contains two items:
```
array (
0 => 'main',
1 => 'wp-embed',
)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue identifies concat-js.php and do_items(); start by tracing how handles is assembled for logged-in and logged-out requests and reproduce the two arrays. Confirm the completed change by verifying that apply_filters('script_loader_tag') fires for the relevant scripts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100