From a1e1f339042bb2afe2101e8959a688d8e9f90e24 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Fri, 18 Dec 2020 12:32:30 +0200 Subject: [PATCH] tweak injectEl --- lib/client-assets.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/client-assets.php b/lib/client-assets.php index 5bcb0cbfe3910c..99a6e631f2e85e 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -812,7 +812,9 @@ function wpEnqueueStyle( handle, src, deps, ver, media ) { // Create the element. var style = document.createElement( 'link' ), isFirst = ! window.wpEnqueueStyleLastInjectedEl, - injectEl = isFirst ? document.head : document.getElementById( window.wpEnqueueStyleLastInjectedEl ), + injectEl = isFirst + ? document.getElementById( 'wp-enqueue-style-script' ) + : document.getElementById( window.wpEnqueueStyleLastInjectedEl ), injectPos = isFirst ? 'afterbegin' : 'afterend'; // Add element props for the stylesheet.