gpp_user_logged_in_condition_is_cacheable
Description
Filter whether Login Status targeting is decided while the page is built. By default, the browser checks Login Status with an AJAX request after the page loads, so a page cache that serves the same copy to logged-in and logged-out visitors cannot show a popup to the wrong one. Return true when your host or caching plugin never serves a cached page to logged-in visitors. The AJAX request is then skipped, and a popup the visitor does not match is left out of the page. A popup that also uses a condition only the browser can decide, such as Custom JavaScript, still waits for the browser. Purge your page cache after adding or removing this filter.
Usage
Applied globally
add_filter( 'gpp_user_logged_in_condition_is_cacheable', 'my_custom_function' );Parameters
$is_cacheable
bool
Whether Login Status is decided while the page is built. Default false.
Examples
Decide Login Status while the page is built
add_filter( 'gpp_user_logged_in_condition_is_cacheable', '__return_true' );Since
1.0.26Hook added.