S
S
Shimpanze2021-07-12 18:42:51
WordPress
Shimpanze, 2021-07-12 18:42:51

Why doesn't buffering work in this case?

ob_start();
wp_enqueue_style( ... );
$element = ob_get_contents();
ob_clean();


Why does the variable $elementcontain an empty string and doesn't catch the WordPress function wp_enqueue_style()?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2021-07-12
@Shimpanze

wp_enqueue_style()
Properly adds the stylesheet CSS file. Registers the style file if it has not already been registered.
...
Returns
null. Returns nothing.

Life hack: 40 minutes of debugging can easily replace 5 minutes of reading documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question