• Resolved sebastianbraune

    (@sebastianbraune)


    Hi,

    I’m using the WPIDE-Plugin to edit the wordpress files on-site in the backend. When editing a file that includes a <body>-Element, Complianz automatically inserts “data-cmplz=1” into the body tag, even if it already has that element. This causes both data inconsistency as it keeps adding the same information to the body tag repeatedly, and also causes the WPIDE plugin to no longer work correctly with any elements that contain a body tag.

    Is there a way to disable this automatic insertion, since I have made sure to include it manually?

    Greetings
    Sebastian Braune

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Really Simple Plugins

    (@reallysimpleplugins)

    You can use the filter cmplz_cookie_blocker_output to strip off the attribute. It is not required for front-end functionality, only to confirm the blocker is working as expected. So you can safely remove it.

    add_filter(‘cmplz_cookie_blocker_output’, ‘my_cmplz_remove_attribute’);
    function my_cmplz_remove_attribute($html){
    return str_replace(‘data-cmplz=1’,”,$html);

    }

    Thread Starter sebastianbraune

    (@sebastianbraune)

    Thank you for the easy solution. For anyone encountering the same issue, there’s a small tweak you’ll need for this line of code, since it also pastes a space.
    Just replace

    return str_replace(‘data-cmplz=1’,”,$html);

    with

    return str_replace(‘data-cmplz=1 ’,”,$html);

    Thread Starter sebastianbraune

    (@sebastianbraune)

    One more addition, because that string replace would also work on the functions.php file, there’s another edit I had to do – build the string in two parts, so the full string would never be shown in one line. The new function looks like:

    function my_cmplz_remove_attribute($html){
    $replace_str = ‘data-cmplz’;
    $replace_str .= ‘=1 ‘;
    return str_replace( $replace_str,”,$html);
    }
    add_filter(‘cmplz_cookie_blocker_output’, ‘my_cmplz_remove_attribute’);

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Compatibility Issue with WPIDE Plugin’ is closed to new replies.