]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/edit-comments.php
WordPress 4.7.2
[autoinstalls/wordpress.git] / wp-admin / edit-comments.php
index fc105feb369b3d6d2d49afee4a0f1d1490ba4a9c..a33f986b3008c5b7e7a70ddb791f936eb31f5793 100644 (file)
@@ -11,7 +11,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
 if ( ! current_user_can( 'edit_posts' ) ) {
        wp_die(
                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
 if ( ! current_user_can( 'edit_posts' ) ) {
        wp_die(
                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
-               '<p>' . __( 'You are not allowed to edit comments.' ) . '</p>',
+               '<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',
                403
        );
 }
                403
        );
 }
@@ -82,6 +82,22 @@ if ( $doaction ) {
                }
        }
 
                }
        }
 
+       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 )
        wp_defer_comment_counting( false );
 
        if ( $approved )
@@ -162,10 +178,10 @@ get_current_screen()->add_help_tab( array(
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
 
 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(
 );
 
 get_current_screen()->set_screen_reader_content( array(
@@ -191,7 +207,7 @@ if ( $post_id ) {
        _e( 'Comments' );
 }
 
        _e( 'Comments' );
 }
 
-if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) {
+if ( isset($_REQUEST['s']) && strlen( $_REQUEST['s'] ) ) {
        echo '<span class="subtitle">';
        /* translators: %s: search keywords */
        printf( __( 'Search results for &#8220;%s&#8221;' ),
        echo '<span class="subtitle">';
        /* translators: %s: search keywords */
        printf( __( 'Search results for &#8220;%s&#8221;' ),
@@ -210,7 +226,7 @@ if ( isset( $_REQUEST['error'] ) ) {
                        $error_msg = __( 'Invalid comment ID.' );
                        break;
                case 2 :
                        $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 )
                        break;
        }
        if ( $error_msg )