wp enqueue style – Why does wp_style_is not return a $handle?
Question
The block of code below returns a list of all $handles.
global $wp_styles;
$handle = $wp_styles->registered[$handle]->handle;
echo $handle;
If the code below is executed, it returns the all the values. It does not however return “abc” for example that was included in the first set of results above.
if ( wp_style_is( $handle, 'enqueued' ) || wp_style_is( $handle, 'queue' ) || wp_style_is( $handle, 'registered' ) || wp_style_is( $handle, 'done' ) || wp_style_is( $handle, 'to_do' ) ) {
echo $handle;
}
Why does the first block return it but not the second?
0
1 year
2022-01-23T04:06:56-05:00
2022-01-23T04:06:56-05:00 0 Answers
0 views
0
Leave an answer