Pulling a parameter out of the URL of a WP link without “?” or being sent to a different page

Supposing you have a page created with the slug “referral”, you can add another segment to the page URL containing the employee ref number like this: 1- Register a new query variable e.g “employee_ref” add_filter(‘query_vars’, function ($query_vars){ $query_vars[] = ’employee_ref’; return $query_vars; }); 2- Using add_rewrite_rule function, add a new rule for the ’employee_ref’ to … Read more

How to create a shortcode with 1 parameter (atts)

Here is how you should create shortcode. First you will have to define $atts item in get_userdata because $atts is an array. Also I think there is also some issues with uppercase attributes names, so you should use attribute in lower case. So instead of userID, use userid. function getUserEmail_func( $atts ) { $user_info = … Read more

Why “?v=hash” is added to my URLs? [closed]

It was woocommerce, it has a setting “geolocalize users with cache support” which adds this parameter to every single url and link. I noticed that the hash appended was the same in every browser on my computer, so I realized it wasn’t a “session” hash, but an IP address hash.