• Iam trying to make a multisite website where i can use unfiltered html on pages

    i added this code to a custom theme

    add_action( 'admin_init', 'my_kses_remove_filters' );
    function my_kses_remove_filters() {
        $current_user = wp_get_current_user();
     
        if ( my_user_has_role( 'administrator', $current_user ) )
            kses_remove_filters();
    }
     
    function my_user_has_role( $role="", $user = null ) {
        $user = $user ? new WP_User( $user ) : wp_get_current_user();
     
        if ( empty( $user->roles ) )
            return;
     
        if ( in_array( $role, $user->roles ) )
            return true;
     
        return;
    }

    It just adds random <br> tags into the code on the frontend and it adds this to the body class customize-support

    You can check out how the page looks here https://warp.warpto.me/test/ you can see how the page should look here https://www.w3schools.com/bootstrap5/bootstrap_templates.php

    As you can see on the page it adds random blank space on top and bottom
    and also there is no css in my custom theme

    • This topic was modified 2 years, 7 months ago by Jan Dembowski.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Allowing unfiltered html in multisite’ is closed to new replies.