Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function cookieplugin() {
- $cookie = wp_get_current_user();
- $site_id = [];
- $id = get_the_id();
- if(isset($_COOKIE['user'])) {
- $site_id[] = $id;
- }
- else {
- setcookie('user', $cookie, time() + 3600*24*100, "/");
- $site_id[] = $id;
- }
- }
- add_action('wp_head', 'cookieplugin');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment