Creating an "Edit Your Profile" link
Since GravityView version 2.14.6, it is now possible to embed the Edit Entry page directly into a Page or Post using the [gventry] shortcode. Click here to know more.
So you're using Gravity Forms and the User Registration add-on to register new WordPress users on your website. Do you want to create an "Edit profile" link that directs users to the Edit Entry page where they can edit their profile from the front end?
That's easy to accomplish using GravityView and the Advanced Filtering extension.
Prefer to Watch the Video?
Step 1: Creating a View
Start by creating a new View using the List View layout. The View layout should be completely empty except for a single Custom Content field. You can use the [gv_entry_link] Shortcode inside this Custom Content field to construct the "Edit Your Profile" link.
Inside the Custom Content text editor, add the following shortcode:
[gv_entry_link action="edit"] Edit your profile [/gv_entry_link]<br>
Step 2: Filtering the View
Next, add an advanced filtering rule to ensure that users can only see the entries they create. To do this, scroll down to the View Settings, click on the Filter & Sort tab and add the following condition:
Note: to learn more about restricting entries to those created by the logged-in user, read How to show only results submitted by the current user.
Step 3: Embedding the View
Now, embed your View wherever you want the "Edit profile" link to show up. To embed it into your sidebar, simply add a Shortcode module and paste the GravityView embed shortcode inside. If you want to hide the link for logged-out users, wrap the shortcode inside the [members_logged_in]
shortcode that comes with the free Members plugin.
Note: Instead of the [members_logged_in]
shortcode, you can also use the built-in [gvlogic]
shortcode to achieve the same result.
To display a welcome message above the "edit profile" link in your sidebar, add the "Login" widget that comes with the Gravity Forms User Registration Add-On.
Step 4: Style the Link
You may have noticed that your link has a border around it. To remove it, add the following CSS to your theme's stylesheet:
.gv-list-view { border: none !important; }
Feel free to add other styles if you so desire.
Step 5: Check it Out on the Front End
When you're done, preview your new "Edit profile" link on the front end.
Note: For a more in-depth tutorial, read our blog post How to Add an “Edit profile” Link to your GravityView Directory.