Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 5 replies, 2 voices, and was last updated 10 years, 9 months ago by
Steven Zahm.
-
AuthorPosts
-
10/28/2015 at 10:25 am #352156
Reed OConnell
ParticipantIs there a way to move the Edit My Directory Entry page (/wp-admin/users.php?page=connections_link) to a page via shortcode and have the same configuration that is setup in the admin regarding what fields are omitted?
Thanks
10/28/2015 at 11:05 am #352164Steven Zahm
Keymaster@ Reed
Here’s the code that’ll create the shortcode:
add_shortcode( 'connections_edit_link', 'cn_edit_my_entry_shortcode' ); function cn_edit_my_entry_shortcode() { // Grab an instance of the Connections object. $instance = Connections_Directory(); // Get the current user ID. $userID = get_current_user_id(); // Check to see if the entry has been linked to a user ID. $entryID = get_user_meta( $userID, 'connections_entry_id', TRUE ); $results = $instance->retrieve->entries( array( 'id' => $entryID ) ); if ( is_user_logged_in() && ( $userID == $results[0]->user && $entryID == $results[0]->id ) && ( current_user_can( 'connections_edit_entry' ) || current_user_can( 'connections_edit_entry_moderated' ) ) ) { return cnURL::permalink( array( 'type' => 'edit', 'slug' => $results[0]->slug, 'text' => 'Edit My Entry', 'return' => TRUE ) ); } }Hope that helps!
10/28/2015 at 12:50 pm #352208Reed OConnell
ParticipantWhat does the actual shortcode look like – what should I add to the page?
I tried [connections_edit_link] but nothing is returned.
The above code was added to the Snippets Plugin.
Thanks
10/28/2015 at 1:00 pm #352209Steven Zahm
Keymaster@ Reed
The shortcode should be
[connections_edit_link]. I tested the code real quick, it works… keep in mind it will only show the edit link for the current logged in user if they have been linked to an entry by the Link extension.Does that help?
10/29/2015 at 9:55 am #352331Reed OConnell
ParticipantThanks – that worked once I approved the listing. The above shortcode produces a link to edit the profile, is there a way to automatically show the profile for editing once on the page? In other words linking to the generic edit page shows the profile for that particular user.
I am trying to add a link to the admin bar menu using the WP Admin UI Customize plugin. The link would be to /edit-directory-profile and once on that page the profile for that user is available to edit.
Thanks
10/29/2015 at 11:12 am #352333Steven Zahm
Keymaster@ Reed
I’m not sure I understand… The link will go directly to the edit page where the user is able to edit their entry… I forgot one thing though… You do have the Form extension installed, yes?
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
