Add ‘title’ attribute to stylesheets with wp_enqueue_style()

Okay, here’s where I’m at with a solution.

wp_enqueue_style( 'my-handle', 'mystyle.css' );
global $wp_styles;
$wp_styles->add_data( 'my-handle', 'title', 'my_stylesheet_title' );

Don’t like using the global. Is there something better?

Leave a Comment

tech