prepare_items(); include 'submissions-list.php'; break; case 'delete': $ID = @$_REQUEST['ID']; if ( is_array( $ID ) && 1 == count( $ID ) ) { $ID = reset( $ID ); } if ( is_array( $ID ) ) { foreach ( $ID as $_ID ) { FQP\DB::delete_row( 'submission', $_ID ); } $_SESSION['FQP_SUBMISSIONS']['messages'][] = 'Submissions have been deleted'; } else { if ( FQP\DB::delete_row( 'submission', $ID ) ) { $_SESSION['FQP_SUBMISSIONS']['messages'][] = 'Submission has been deleted'; } } wp_redirect( get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=' . rawurlencode( $_REQUEST['page'] ) ); break; case 'view': $ID = @$_REQUEST['ID']; if ( ! $ID ) { wp_die( __METHOD__ . ': Something went wrong!' ); } $view = new \FQP\SubmissionView( $ID ); $submission = $view->get(); if ( ! $submission ) { wp_die( __METHOD__ . ': Something went wrong!' ); } include 'submissions-view.php'; break; default: wp_die( __METHOD__ . ': Something went wrong!' ); break; } ?>