if ( ! current_user_can( 'edit_posts' ) ) {
wp_die(
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
- '<p>' . __( 'You are not allowed to edit comments.' ) . '</p>',
+ '<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',
403
);
}
}
}
+ if ( ! in_array( $doaction, array( 'approve', 'unapprove', 'spam', 'unspam', 'trash', 'delete' ), true ) ) {
+ /**
+ * Fires when a custom bulk action should be handled.
+ *
+ * The redirect link should be modified with success or failure feedback
+ * from the action to be used to display feedback to the user.
+ *
+ * @since 4.7.0
+ *
+ * @param string $redirect_url The redirect URL.
+ * @param string $doaction The action being taken.
+ * @param array $items The items to take the action on.
+ */
+ $redirect_to = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $comment_ids );
+ }
+
wp_defer_comment_counting( false );
if ( $approved )
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
- '<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
- '<p>' . __( '<a href="https://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
- '<p>' . __( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
- '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
+ '<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments">Documentation on Comments</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Comment_Spam">Documentation on Comment Spam</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
);
get_current_screen()->set_screen_reader_content( array(
$error_msg = __( 'Invalid comment ID.' );
break;
case 2 :
- $error_msg = __( 'You are not allowed to edit comments on this post.' );
+ $error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' );
break;
}
if ( $error_msg )