wp/wp-admin/edit-comments.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
     7  */
     7  */
     8 
     8 
     9 /** WordPress Administration Bootstrap */
     9 /** WordPress Administration Bootstrap */
    10 require_once( dirname( __FILE__ ) . '/admin.php' );
    10 require_once( dirname( __FILE__ ) . '/admin.php' );
    11 if ( !current_user_can('edit_posts') )
    11 if ( !current_user_can('edit_posts') )
    12 	wp_die(__('Cheatin’ uh?'));
    12 	wp_die( __( 'Cheatin’ uh?' ), 403 );
    13 
    13 
    14 $wp_list_table = _get_list_table('WP_Comments_List_Table');
    14 $wp_list_table = _get_list_table('WP_Comments_List_Table');
    15 $pagenum = $wp_list_table->get_pagenum();
    15 $pagenum = $wp_list_table->get_pagenum();
    16 
    16 
    17 $doaction = $wp_list_table->current_action();
    17 $doaction = $wp_list_table->current_action();
   107 if ( $post_id )
   107 if ( $post_id )
   108 	$title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) );
   108 	$title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) );
   109 else
   109 else
   110 	$title = __('Comments');
   110 	$title = __('Comments');
   111 
   111 
   112 add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) );
   112 add_screen_option( 'per_page' );
   113 
   113 
   114 get_current_screen()->add_help_tab( array(
   114 get_current_screen()->add_help_tab( array(
   115 'id'		=> 'overview',
   115 'id'		=> 'overview',
   116 'title'		=> __('Overview'),
   116 'title'		=> __('Overview'),
   117 'content'	=>
   117 'content'	=>
   119 ) );
   119 ) );
   120 get_current_screen()->add_help_tab( array(
   120 get_current_screen()->add_help_tab( array(
   121 'id'		=> 'moderating-comments',
   121 'id'		=> 'moderating-comments',
   122 'title'		=> __('Moderating Comments'),
   122 'title'		=> __('Moderating Comments'),
   123 'content'	=>
   123 'content'	=>
   124 		'<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
   124 		'<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' .
   125 		'<p>' . __( 'In the <strong>Author</strong> column, in addition to the author&#8217;s name, email address, and blog URL, the commenter&#8217;s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
   125 		'<p>' . __( 'In the <strong>Author</strong> column, in addition to the author&#8217;s name, email address, and blog URL, the commenter&#8217;s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
   126 		'<p>' . __( 'In the <strong>Comment</strong> column, above each comment it says &#8220;Submitted on,&#8221; followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
   126 		'<p>' . __( 'In the <strong>Comment</strong> column, above each comment it says &#8220;Submitted on,&#8221; followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
   127 		'<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
   127 		'<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
   128 		'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>'
   128 		'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>'
   129 ) );
   129 ) );
   130 
   130 
   131 get_current_screen()->set_help_sidebar(
   131 get_current_screen()->set_help_sidebar(
   132 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
   132 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
   133 	'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
   133 	'<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
   134 	'<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
   134 	'<p>' . __( '<a href="https://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
   135 	'<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
   135 	'<p>' . __( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
   136 	'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
   136 	'<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
   137 );
   137 );
   138 
   138 
   139 require_once( ABSPATH . 'wp-admin/admin-header.php' );
   139 require_once( ABSPATH . 'wp-admin/admin-header.php' );
   140 ?>
   140 ?>
   141 
   141 
   142 <div class="wrap">
   142 <div class="wrap">
   143 <?php screen_icon(); ?>
       
   144 <h2><?php
   143 <h2><?php
   145 if ( $post_id )
   144 if ( $post_id )
   146 	echo sprintf( __( 'Comments on &#8220;%s&#8221;' ),
   145 	echo sprintf( __( 'Comments on &#8220;%s&#8221;' ),
   147 		sprintf( '<a href="%s">%s</a>',
   146 		sprintf( '<a href="%s">%s</a>',
   148 			get_edit_post_link( $post_id ),
   147 			get_edit_post_link( $post_id ),
   216 					$messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
   215 					$messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
   217 					break;
   216 					break;
   218 			}
   217 			}
   219 		}
   218 		}
   220 
   219 
   221 		echo '<div id="moderated" class="updated"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
   220 		echo '<div id="moderated" class="updated notice is-dismissible"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
   222 	}
   221 	}
   223 }
   222 }
   224 ?>
   223 ?>
   225 
   224 
   226 <?php $wp_list_table->views(); ?>
   225 <?php $wp_list_table->views(); ?>
   227 
   226 
   228 <form id="comments-form" action="" method="get">
   227 <form id="comments-form" method="get">
   229 
   228 
   230 <?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
   229 <?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
   231 
   230 
   232 <?php if ( $post_id ) : ?>
   231 <?php if ( $post_id ) : ?>
   233 <input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
   232 <input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />