-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwp-cache-postload.php
More file actions
39 lines (36 loc) · 1.34 KB
/
wp-cache-postload.php
File metadata and controls
39 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
use WebSharks\CometCache\Pro as Plugin;
/**
* Postload event handler; overrides core WP function.
*
* @since 140422 First documented version.
*
* @note See `/wp-settings.php` around line #226.
*/
function wp_cache_postload()
{
$GLOBAL_NS = Plugin\GLOBAL_NS;
$advanced_cache = $GLOBALS[$GLOBAL_NS.'_advanced_cache'];
if (!$advanced_cache->is_running) {
return; // Not applicable.
}
do_action('before_'.$GLOBAL_NS.'_'.__FUNCTION__, get_defined_vars());
/*[pro strip-from="lite"]*/
if (!empty($advanced_cache->postload['invalidate_when_logged_in'])) {
$advanced_cache->maybeInvalidateWhenLoggedInPostload();
}
if (!empty($advanced_cache->postload['when_logged_in'])) {
$advanced_cache->maybeStartObWhenLoggedInPostload();
} /*[/pro]*/
if (!empty($advanced_cache->postload['filter_status_header'])) {
$advanced_cache->maybeFilterStatusHeaderPostload();
}
if (!empty($advanced_cache->postload['set_debug_info'])) {
$advanced_cache->maybeSetDebugInfoPostload();
}
if (!empty($advanced_cache->postload['wp_main_query'])) {
add_action('wp', [$advanced_cache, 'wpMainQueryPostload'], PHP_INT_MAX);
}
do_action('after_'.$GLOBAL_NS.'_'.__FUNCTION__, get_defined_vars());
do_action($GLOBAL_NS.'_'.__FUNCTION__.'_complete', get_defined_vars());
}