Skip to content

Commit 245e828

Browse files
committed
simplify error messages
1 parent ecf892b commit 245e828

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

includes/admin/class-admin.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,11 @@ public function export_forms() {
171171
*/
172172
public function export_form_entries() {
173173
if ( ! current_user_can( 'administrator' ) ) {
174-
$error = new WP_Error( 'rest_weforms_invalid_permission', __( 'You do not have permission to export entries', 'weforms' ), [ 'status' => 404 ] );
175-
wp_die( esc_html__( $error->get_error_message(), 'weforms' ) );
174+
wp_die( esc_html__( 'You do not have permission to export entries', 'weforms' ) );
176175
}
177176

178177
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'weforms-export-entries' ) ) {
179-
$error = new WP_Error( 'rest_weforms_invalid_nonce', __( 'Invalid nonce', 'weforms' ), [ 'status' => 404 ] );
180-
wp_die( esc_html__( $error->get_error_message(), 'weforms' ) );
178+
wp_die( esc_html__( 'Invalid nonce', 'weforms' ) );
181179
}
182180

183181
$form_id = isset( $_REQUEST['selected_forms'] ) ? absint( $_REQUEST['selected_forms'] ) : 0;

0 commit comments

Comments
 (0)