diff --git a/core/um-enqueue.php b/core/um-enqueue.php index c2bf3350..1c261ea5 100644 --- a/core/um-enqueue.php +++ b/core/um-enqueue.php @@ -18,11 +18,10 @@ class UM_Enqueue { $exclude = um_get_option('js_css_exclude'); if ( $exclude && is_array( $exclude ) ) { - $c_url = untrailingslashit( $ultimatemember->permalinks->get_current_url(true) ); + $c_url = trailingslashit( $ultimatemember->permalinks->get_current_url(true) ); - foreach( $exclude as $url ) { - $url = untrailingslashit( $url ); - if ( $url == $c_url ) + foreach( $exclude as $match ) { + if ( strstr( $c_url, $match ) ) return; } diff --git a/um-config.php b/um-config.php index 6a0c6f19..4ad0929f 100644 --- a/um-config.php +++ b/um-config.php @@ -1413,9 +1413,9 @@ $this->sections[] = array( 'id' => 'js_css_exclude', 'type' => 'multi_text', 'default' => array(), - 'title' => __( 'Exclude URLs from loading plugin CSS and JS' ), - 'desc' => __( 'Here you can exclude specific URLs from loading the plugin CSS and JS files.' ), - 'add_text' => __('Add New URL'), + 'title' => __( 'Never load plugin JS and CSS on the following pages' ), + 'desc' => __( 'Enter a url or page slug (e.g /about/) to disable loading the plugin\'s css and js on that page.' ), + 'add_text' => __('Add New Page'), ), array(