Updating custom user meta
You can create a similar solution as the one with a form and submit button by adding an onclick event to your button: <button id=”updateMyUserMeta” name=”updateMyUserMeta” onclick=”window.location.href(‘http://example.com?my_custom_user_meta=true’);”>Update</button> Then add this to the functions.php of your theme. /** * Updates the ‘my_custom_user_meta’ field if the * user clicks the ‘Update’ button. */ function update_my_custom_user_meta() { if … Read more