Skip to content

Commit bafba80

Browse files
pbearnewestonruter
andauthored
Update plugins/dominant-color-images/hooks.php
Co-authored-by: Weston Ruter <[email protected]>
1 parent 9cbdfef commit bafba80

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plugins/dominant-color-images/hooks.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ function dominant_color_admin_script(): void {
221221
<script type="module">
222222
const tmpl = document.getElementById( 'tmpl-attachment' );
223223
if ( tmpl ) {
224-
tmpl.textContent = tmpl.textContent.replace( /^\s*<div[^>]*?(?=>)/, ( match ) => {
225-
let replaced = match.replace( /\sclass="/, " class=\"{{ data.hasTransparency ? \'has-transparency\' : \'not-transparent\' }} " );
226-
replaced += ' data-dominant-color="{{ data.dominantColor }}"';
227-
replaced += ' data-has-transparency="{{ data.hasTransparency }}"';
228-
replaced += ' style="--dominant-color: #{{ data.dominantColor }};"'; // TODO: Potentially there could be a style attribute as well!
229-
return replaced;
230-
} );
224+
tmpl.textContent = tmpl.textContent.replace( /^\s*<div[^>]*?(?=>)/, ( match ) => {
225+
let replaced = match.replace( /\sclass="/, " class=\"{{ data.hasTransparency ? \'has-transparency\' : \'not-transparent\' }} " );
226+
replaced += ' data-dominant-color="{{ data.dominantColor }}"';
227+
replaced += ' data-has-transparency="{{ data.hasTransparency }}"';
228+
replaced += ' style="--dominant-color: #{{ data.dominantColor }};"'; // TODO: Potentially there could be a style attribute as well!
229+
return replaced;
230+
} );
231231
}
232232
</script>
233233
<?php

0 commit comments

Comments
 (0)