Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions gp-nested-forms/gpnf-disable-sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,17 @@
function gw_gpnf_disable_session() {
remove_action( 'wp_ajax_gpnf_session', array( gp_nested_forms(), 'ajax_session' ) );
remove_action( 'wp_ajax_nopriv_gpnf_session', array( gp_nested_forms(), 'ajax_session' ) );
// Delete previous stored session.
$session = new GPNF_Session( '4' ); // Update "4" to the ID of the parent form.
$session->delete_cookie();
}

// Allow non-admin users to edit or delete entry.
add_filter( 'gpnf_can_user_edit_entry', function( $can_user_edit_entry, $entry ) {
// Update "5" to the ID of the child form.
if ( $entry['form_id'] == '5' ) {
return true;
}

return $can_user_edit_entry;
}, 10 , 2);