Let user edit their profile on the front end with a snippet

I’m working on my first wordpress site. I want to create a form which will allow a logged in user to edit their user_nicename .

I have two main questions about this.

How do I do this?

Right now, I’ve got an HTML form like so. I think that onclick() attribute is meant for a javascript function, and if I use a js function with ajax, I’m not sure how to call a PHP snippet from there.

<form action=’?page_id=10′ method=’POST’>
New username: <br>
<input type=’text’ name=’username’><br>
<input type=’submit’ value=’Submit’ onclick=”>
</form>

Should I be doing this? Is there a better way? Because I think the theme of the website is likely to change, I’ve been using XYZ html/php snippets for everything.

Since I can’t seem to find much about updating user information through snippets, I’m wondering if I’m expected to do it some other way.

Thanks!

Read more here:: Let user edit their profile on the front end with a snippet

Leave a Reply

Your email address will not be published. Required fields are marked *