mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-12 19:26:35 +09:00
Added option to exclude URLs from printing CSS/JS
This commit is contained in:
+16
-1
@@ -12,7 +12,22 @@ class UM_Enqueue {
|
||||
*** @Enqueue scripts and styles
|
||||
***/
|
||||
function wp_enqueue_scripts(){
|
||||
|
||||
|
||||
global $ultimatemember;
|
||||
|
||||
$exclude = um_get_option('js_css_exclude');
|
||||
if ( $exclude && is_array( $exclude ) ) {
|
||||
|
||||
$c_url = untrailingslashit( $ultimatemember->permalinks->get_current_url(true) );
|
||||
|
||||
foreach( $exclude as $url ) {
|
||||
$url = untrailingslashit( $url );
|
||||
if ( $url == $c_url )
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( um_get_option('disable_minify') ) {
|
||||
|
||||
$this->load_original();
|
||||
|
||||
@@ -1409,6 +1409,15 @@ $this->sections[] = array(
|
||||
'desc' => __('Not recommended. This will load all plugin js and css files separately and may slow down your website. Use this setting for development or debugging purposes only.','ultimatemember'),
|
||||
),
|
||||
|
||||
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'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'allow_tracking',
|
||||
'type' => 'switch',
|
||||
|
||||
Reference in New Issue
Block a user