Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Preload with mandatory/dynamic cookies
add_filter( 'rocket_partial_preload_url_request_args', 'rocket_add_cookie_preload' );
add_filter( 'rocket_preload_url_request_args', 'rocket_add_cookie_preload' );
function rocket_add_cookie_preload( $args ) {
$cookies = [
new WP_Http_Cookie(
[
'name' => 'cookie_notice_accepted',
'value' => 'true',
] ),
];
$args['cookies'] = $cookies;
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment