Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use https://wpengine.com/support/cache/#Default_Cache_Exclusions instead.

LLMS_Cache_Helper::exclude_page_from_wpe_server_cache( int|WP_Post $post = null )

Sets a browser cookie that tells WP Engine to exclude a page from server caching.


Description Description

See also See also


Top ↑

Parameters Parameters

$post

(int|WP_Post) (Optional) Post ID or post object. Default is the global $post.

Default value: null


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.cache.helper.php

	private function exclude_page_from_wpe_server_cache( $post = null ) {

		if ( function_exists( 'is_wpe' ) && is_wpe() ) {
			/*
			 * If "Settings -> Permalinks" is "Plain", i.e. the `permalink_structure` option is '',
			 * allow the entire site to be cached by WP Engine.
			 * Note: This will prevent users from being able to successfully use the "Lost your password?" feature.
			 */
			if ( isset( $GLOBALS['wp_rewrite'] ) && ! $GLOBALS['wp_rewrite']->using_permalinks() ) {
				return;
			}

			$path = wp_parse_url( get_permalink( $post ), PHP_URL_PATH );
			llms_setcookie( 'wordpress_wpe_no_cache', '1', 0, $path, COOKIE_DOMAIN, is_ssl(), true );
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.