Adding metadata to an inline CSS style element


The current WordPress theme generates inline CSS that outputs a stylesheet as // CSS .

I need to additional custom attributes such that it returns the stylesheet as <style id = "style-handle-inline-css" custom_attribute_one="value" custome_attribute_two="value">

Based on article from Gary Jones, my understanding is that $wp_styles->add_data supports the option to add arbitrary metadata such as

$wp_styles->add_data("$handle", "custom_attribute_one, "value");

When the line above is executed, all it returns is <style id = "style_handle-inline-css" type="text/css"> // CSS </style>.

How can I add custom attributes to inline CSS styles?

Ryan 2 years 2020-10-22T21:10:18-05:00 0 Answers 8 views 0

Leave an answer