Hi.
The intent is to change color format in a chat if the text is between () or <>.
So, I find this piece of code:
<?php
function chatcolor($str) {
$search = [
'#\<(.+?)\>#is',
'#\[(.+?)\]#is',
];
$replace = [
'<span class="color2"><$1></span>',
'<span class="color2"><$1></span>',
];
return preg_replace($search, $replace, $str);
}
?>
So I put in my CSS:
.color2 {
color: #ff0000;
}
And then I create an Element with hook to wp-head, PHP execute, position the page where the chat is .
But it does not function. Where I’m wrong? The code, the css or the Element specs?