How to resolve conflict between weForms and LearnPress

WordPress theme plugin conflict

In some cases, weForms users faces the blank screen on the weForms settings if they have the LearnPress installed. The same may happen for the LeanPress settings or both of them.

Actually, it’s because of a tiny conflict on a function between weForms and LearnPress. However, I have found a simple snippet to solve this problem.

READ  Best practice to find WordPress theme and plugin conflicts

Here is the snippet that can help you to ride out of it.

add_filter( 'learn-press/admin-default-scripts', 'rt_replace_js' );
function rt_replace_js( $data ){
    $screen = get_current_screen();
    if ( $screen->base != 'toplevel_page_weforms' ) {
        return $data;
    }
    return array();
}

Insert this snippet in your theme function.php file and save it.

Note: It’s good to have a backup before adding codes to a file. Please make sure you have taken a complete backup of your site or the file you are editing.

Leave a Reply