@ Jo Marks
re: Edit My Directory Listing from under the Howdy it takes me to the correct listing but not in Form in Connections itself.
That would be correct. The adminbar link will always to the user to the admin side. In this case it would be the user’s Link admin profile page. That is what you are seeing, correct? The page URL would end like this:
../wp-admin/users.php?page=connections_link
If you are, then Link is working correctly, so that is very good. The issue would be that the Sidebar Login widget is no longer displaying the edit link, is that correct?
I took a look at the code for Sidebar Login and it does support shortcodes, however, the shortcode for the edit link from the other post will not work correctly for the way Sidebar Login needs. Try this instead:
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, 'data' => 'url', 'return' => TRUE ) );
}
}
Then in the Sidebar Login widget use this for the logged in link:
Edit My Directory Entry | [connections_edit_link]
Now does that work?
