Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 130709

Hook on apply_filters vs do_cacheaction

$
0
0

Replies: 0

Hello,

I noticed something strange with desktop / mobile cached files.

WP Super Cache: 1.4.8
WordPress: 4.6.1

File: wp-cache-phase1.php
Line: 73
add_cacheaction( 'supercache_filename_str', 'wp_cache_check_mobile' );

Line654+

if ( function_exists( "apply_filters" ) ) {
	$extra_str = apply_filters( 'supercache_filename_str', $extra_str );
} else {
	$extra_str = do_cacheaction( 'supercache_filename_str', $extra_str );
}

Why don’t you use this code instead?
add_filter( 'supercache_filename_str', 'wp_cache_check_mobile' );
=> Hook always returns empty because nothing has been added to apply_filters in Phase 1.

What I observed:
Phase 1 will always return index.html et never index-mobile.html file
Phase 2 will create index-mobile.html file only if no file exist

Thanks for you help

  • This topic was modified 7 minutes ago by  jneiluj.
  • This topic was modified 7 minutes ago by  jneiluj.

Viewing all articles
Browse latest Browse all 130709

Trending Articles