Added option to exclude URLs from printing CSS/JS

This commit is contained in:
ultimatemember
2015-01-16 13:55:26 +02:00
parent 978b786c10
commit 148b85591c
2 changed files with 25 additions and 1 deletions
+16 -1
View File
@@ -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();
+9
View File
@@ -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',