Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Created January 22, 2018 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wokamoto/6ca10bced5ca18562273745b50a7a428 to your computer and use it in GitHub Desktop.
Save wokamoto/6ca10bced5ca18562273745b50a7a428 to your computer and use it in GitHub Desktop.
[WordPress][CloudFront] ログイン時にプレビューが即時反映されない問題に対する fix 案
<?php
// CloudFront で Cookie key wordpress_last_visit をオリジンに渡すようにしておくこと
add_action( 'plugins_loaded', function(){
if ( is_user_logged_in() ) {
setcookie( 'wordpress_last_visit', time() );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment