@ dominic
The virtual page for form is like the /edit/ link except it’s /submit/ If you have this link disabled under the List Actions then normal users can not get to it … now, if a users happened to know about the existence of the /submit/ link they could manually type that in and be able to submit multiple entries. Really though, that’s not going to be an issue because that is simply something a typical user is going to figure out.
Now, because you’re using the legacy [connections_form] shortcode … as long as the link to that page is visible to users, they’ll be able to submit entries.
As for the edit link code something like this may work (untested):
public function widget() {
if ( get_query_var('cn-entry-slug') ) {
// Grab an instance of the Connections object.
$instance = Connections_Directory();
// Check to see if the entry has been linked to a user ID.
$entryID = get_user_meta( get_current_user_id(), 'connections_entry_id', TRUE );
// var_dump( $entryID );
$results = $instance->retrieve->entries( $atts );
// var_dump( $results );
if ( is_user_logged_in() &&
( current_user_can( 'connections_manage' ) || $entryID == $results[0]->id ) &&
( current_user_can( 'connections_edit_entry' ) ||
current_user_can( ‘connections_edit_entry_moderated’ ) )
) {
cnURL::permalink( array( 'type' => 'edit', 'slug' =>
get_query_var('cn-entry-slug'), 'text' => __( 'Edit Entry', 'connections_form' ), 'return' => FALSE ) );
}
}
}
The above would be the widget override method in your widget class.
Hope that helps you out.
