@ karen
re: I need to place the Form for users to submit their own listings on a custom page. That page will be placed behind a content-restriction wall (using Woocommerce Membership plugin to restrict access to the page). I used to be able to do this using the [connections_form] shortcode. However, I understand that use of that shortcode has been discontinued, and we are now supposed to enable to function for users to just click a button to Add New Directory. However, I don’t want that button/link to be on the same page as the Directory.
You can continue to use the shortcode. I will not be removing it. In fact, just last week, I added new shortcode options to it at another user’s request. I will be greatly de-emphasizing the use of the shortcode mostly for beginner WordPress users because they are difficult to understand. My goal will be to make thing more and more point and click friendly.
re: is there a way to get a link or button to Edit listing on this page, instead of on the Directory page?
Install the code Snippets plugin.
Add a new code snippet with the following code:
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 ) );
}
}
Save and activate the snippet.
Add the [connections_edit_link] shortcode to your members profile page.
Hope this helps, let me know.
