Cookie question

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

How can I access user information on a subdomain?

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) );

WordPress keep logged in after browser close

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; });

How to get the id dynamically to store cookies

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

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduseduedueduseduedueduedusedu