gpp_user_logged_in_condition_is_cacheable

  1. Description
  2. Usage
  3. Parameters
  4. Examples
  5. Since

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

add_filter( 'gpp_user_logged_in_condition_is_cacheable', '__return_true' );

Since

  • 1.0.26 Hook added.