Clean up error messages part 2
This commit is contained in:
parent
6d991dc717
commit
98bb68009d
@ -1561,11 +1561,11 @@ function fictioneer_ajax_search_posts_to_unlock() {
|
||||
$user = fictioneer_get_validated_ajax_user( 'nonce', 'search_posts' );
|
||||
|
||||
if ( ! $user ) {
|
||||
wp_send_json_error( array( 'error' => __( 'Request did not pass validation.', 'fictioneer' ) ) );
|
||||
wp_send_json_error( array( 'error' => 'Request did not pass validation.' ) );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'manage_options' ) && ! current_user_can( 'fcn_unlock_posts' ) ) {
|
||||
wp_send_json_error( array( 'error' => __( 'Insufficient permissions.', 'fictioneer' ) ) );
|
||||
wp_send_json_error( array( 'error' => 'Insufficient permissions.' ) );
|
||||
}
|
||||
|
||||
// Setup
|
||||
|
2
js/admin.min.js
vendored
2
js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1161,10 +1161,12 @@ function fcn_unlockPostsSearch() {
|
||||
results.innerHTML = response.data.html;
|
||||
} else {
|
||||
results.innerHTML = response.data.error;
|
||||
console.error('Error:', response.data.error);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
results.innerHTML = error;
|
||||
console.error('Error:', error);
|
||||
})
|
||||
.then(() => {
|
||||
container.classList.remove('ajax-in-progress');
|
||||
|
Loading…
x
Reference in New Issue
Block a user