Need help for deleting a WordPress Cookie with setcookie() Not Working
Need help for deleting a WordPress Cookie with setcookie() Not Working
Need help for deleting a WordPress Cookie with setcookie() Not Working
You can set the cookies on the two different pages by modifying your code to include the logic for setting the cookies when a user clicks on one of the options. Here’s the updated code: function my_page_template_redirect() { if ( isset( $_COOKIE[“landvanbartje_cookie”] ) ) { if( $_COOKIE[“landvanbartje_cookie”] == “buiten_seizoen” ) { wp_redirect( ‘/omgeving-rust-ruimte/’ ); exit; … Read more
Found two solutions: 1) global $current_user; $wp_get_current_user_id = $current_user->ID; $wp_get_current_user_id = apply_filters( ‘determine_current_user’, false ); Which then in helloworld.php would be return: echo json_encode( array(‘wordpress_user_id’ => wp_get_current_user_id) );
You can use the following 2 filter hooks add_filter(‘auth_cookie_expiration’, ‘auth_cookie_expiration_filter_5587’); function auth_cookie_expiration_filter_5587() { return YEAR_IN_SECONDS * 5; } and: add_filter(‘auth_cookie_expiration’, function () { return YEAR_IN_SECONDS * 5; });
If you want the ID of the current post outside of the loop, you can use get_queried_object_id(). Just make sure to check is_singular() first, or you could end up storing IDs of things other than posts. This could cause problems if there’s overlap with post IDs. I’d share the amended code with those changes, but … Read more
How to use Cookie or Session php for one page and just a password
setcookie not working when defined with ‘/’ but working if not defined
I don’t think sending your user off site is the best handling in the first place. I would honestly just use Gravity Forms and use the User Registration Add on – if you are already paying for your plugins. It just seems to weird to me to send your user offsite to register, but I’m … Read more
Logged In cookie gets saved but not Auth cookie
Use your FTP client or cPanel: Open file style.css Rename the Active theme before updating. Successfully logged in. Change back to the original Theme.