Skip to content

Commit

Permalink
Filter to allow requests not being enqueued (e.g. if is_404 is broken).
Browse files Browse the repository at this point in the history
  • Loading branch information
futtta committed Jul 2, 2020
1 parent e339e26 commit bd0f16a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/autoptimizeCriticalCSSEnqueue.php
Expand Up @@ -27,7 +27,7 @@ public static function ao_ccss_enqueue( $hash ) {
$enqueue = true;

// ... which are not the ones below.
if ( is_user_logged_in() || is_feed() || is_404() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || $self->ao_ccss_ua() || 'nokey' == $key['status'] || 'invalid' == $key['status'] ) {
if ( is_user_logged_in() || is_feed() || is_404() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || $self->ao_ccss_ua() || 'nokey' == $key['status'] || 'invalid' == $key['status'] || false === apply_filters( 'autoptimize_filter_ccss_enqueue_should_enqueue', true ) ) {
$enqueue = false;
autoptimizeCriticalCSSCore::ao_ccss_log( "Job queuing is not available for WordPress's logged in users, feeds, error pages, ajax calls, to criticalcss.com itself or when a valid API key is not found", 3 );
}
Expand Down

0 comments on commit bd0f16a

Please sign in to comment.