Using the block of code below, it displays a list of enqueued styles for a given theme.
function mg_print_styles() {
global $wp_styles;
foreach( $wp_styles->queue as $handle ) :
echo '<div class="theme-style">Style <br />';
echo "Handle: " . $handle . '<br />';
echo "URL: " . $wp_styles->registered[$handle]->src;
echo '</div>';
endforeach;
}
add_action( 'wp_print_scripts', 'mg_print_styles', 100 );
Additional styles not included the list above are returned when using the filter style_loader_tag
.
Questions
- Why are these styles not in the list of enqueued styles? If they are manually enqueued, they are returned in the list.
- How can I enqueue them without having to add these one at a time?