Let WordPress to go opening an external URL

You forgot to add the “http” to the url Try please this: $link = “<a href=”http://”https://wordpress.stackexchange.com/questions/254153/. $_COOKIE[“link’] .”‘>TEXT SHOWN</a>”; You also can adjust and add the http:// to the $_COOKIE itself. If you want that the new link will open in a new tab, add target=”_blank” like so: $link = “<a href=”http://”https://wordpress.stackexchange.com/questions/254153/. $_COOKIE[“link’] .”‘ target=”_blank”>TEXT … Read more

How can I save cookies to members

You can can read the cookie and check if the current user is logged in using get_current_user_id(). If they are just save the cookie value to the user_meta. $cookie_name=””; if( isset( $_COOKIE[$cookie_name] ) ) { $user_id = get_current_user_id(); if( $user_id ) { $meta_key = $cookie_name; $meta_value = $_COOKIE[$cookie_name]; update_user_meta( $user_id, $meta_key, $meta_value ); } }

Why isn’t my cookie setting in my function?

Setting cookies is done via HTTP headers. This means you can’t set any cookies via serverside methods (PHP->WordPress) anymore after any content has been sent to the browser. A working example of setting cookies in WordPress (in one of my plugins): Cookie Manager: https://github.com/download-monitor/download-monitor/blob/e26022f9a96abf174a874873b8cd35a0db98882b/includes/class-dlm-cookie-manager.php Setting the actual cookie: https://github.com/download-monitor/download-monitor/blob/e26022f9a96abf174a874873b8cd35a0db98882b/includes/class-dlm-download-handler.php#L416 The cookie is set on the … Read more

Capture and display users name

Use wp_get_current_user to get the current user (if any) then check or update the display name – update_user_meta or wp_update_user. When you have a user, you’ll probably want to set a flag on the user’s meta for after they have filled out their name, or prompt otherwise. How/where all this would go is really a … Read more

Cookie is not set

This is the correct format for a cookie to expire in one hour (3600 seconds): setcookie(‘rma_member’, true, time() + 3600, COOKIEPATH, COOKIE_DOMAIN); setcookie Expire: The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you’ll most likely set this with the time() function … Read more