[Support request] Elements – Change color format

Home Forums Support Elements – Change color format

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1359741
    BFB Insurance Broker

    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?

    #1360198
    Leo
    Staff
    Customer Support

    Hi there,

    I’m not sure where that code is coming from and what is supposed to do.

    Have you checked with the code author?

    GP doesn’t have built-in chat so it must be coming from a plugin?

    #1360602
    BFB Insurance Broker

    Hi Leo and thank for response.

    The chat comes from Wise Chat Plugin and I ask them for.
    The answer was they have no time for that (soooo kind) and I’m trying to make it from myself.
    I’m not so strong on coding, so I found that piece of code in another chat file, trying to adapt that on my intent.

    If it’s possible to reach the goal, it’s right.
    Otherwise, thanks for support anyway.^^

    #1361090
    Leo
    Staff
    Customer Support

    Unfortunately providing a custom solution like this is out of the scope of this forum.

    The questions here should be directly related to GP.

    Thanks for your understanding 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.