Filters to Exclude JS Combination and Deferral (Per Page Basis)
-
Good Day,
We are using Speed Optimizer to combine all of our JS files and the deferral of all render-blocking files, including jQuery. It’s working great. However, we need filters to exclude the combination and deferral of jQuery on one of our pages (say, “custom-login-page“). What filters can we use?
For example, the following filters are not working for us:
add_action( 'wp_footer', function () { if ( ! is_page('custom-login-page') ) return; add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude_login' ); function js_combine_exclude_login( $exclude_list ) { $exclude_list[] = 'jquery-core'; return $exclude_list; } } );
add_action( 'wp_footer', function () { if ( ! is_page('custom-login-page') ) return; add_filter( 'sgo_js_async_exclude', 'js_async_exclude_login' ); function js_async_exclude_login( $exclude_list ) { $exclude_list[] = 'jquery-core'; return $exclude_list; } } );
Note: Our page, “custom-login-page“, is our mask for our “wp-admin” login page.
Thank you.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Filters to Exclude JS Combination and Deferral (Per Page Basis)’ is closed to new replies.