mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 13:41:24 +01:00
Comment List Tables:
* Declare `$extra_items` property * Since `->get_column_info()` overrides its parent's method, it doesn't need to set `_column_headers`, which is an undeclared property that is only used for caching the lookup after the first run in the parent class, which isn't called in the child class. * `$_args` in `WP_List_Table` has to be `protected` for `WP_Post_Comments_List_Table` to legally access it. `$_args` is awkward as is and should probably be only available via a getter. See #30799. Built from https://develop.svn.wordpress.org/trunk@30984 git-svn-id: http://core.svn.wordpress.org/trunk@30970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
786caa4d55
commit
bc1341628f
@ -21,6 +21,8 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
public $pending_count = array();
|
||||
|
||||
public $extra_items;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@ -379,12 +381,10 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
global $comment_status;
|
||||
$post = get_post();
|
||||
|
||||
$user_can = $this->user_can;
|
||||
|
||||
$comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
|
||||
$the_comment_status = wp_get_comment_status( $comment->comment_ID );
|
||||
|
||||
if ( $user_can ) {
|
||||
if ( $this->user_can ) {
|
||||
$del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
|
||||
$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
|
||||
|
||||
@ -420,7 +420,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
echo '</div>';
|
||||
comment_text();
|
||||
if ( $user_can ) { ?>
|
||||
if ( $this->user_can ) { ?>
|
||||
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
|
||||
<textarea class="comment" rows="1" cols="1"><?php
|
||||
/** This filter is documented in wp-admin/includes/comment.php */
|
||||
@ -434,7 +434,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $user_can ) {
|
||||
if ( $this->user_can ) {
|
||||
// Preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash.
|
||||
$actions = array(
|
||||
'approve' => '', 'unapprove' => '',
|
||||
@ -596,7 +596,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
|
||||
|
||||
protected function get_column_info() {
|
||||
$this->_column_headers = array(
|
||||
return array(
|
||||
array(
|
||||
'author' => __( 'Author' ),
|
||||
'comment' => _x( 'Comment', 'column name' ),
|
||||
@ -604,8 +604,6 @@ class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
|
||||
array(),
|
||||
array(),
|
||||
);
|
||||
|
||||
return $this->_column_headers;
|
||||
}
|
||||
|
||||
protected function get_table_classes() {
|
||||
|
@ -24,9 +24,9 @@ class WP_List_Table {
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var array
|
||||
* @access private
|
||||
* @access protected
|
||||
*/
|
||||
private $_args;
|
||||
protected $_args;
|
||||
|
||||
/**
|
||||
* Various information needed for displaying the pagination
|
||||
|
Loading…
Reference in New Issue
Block a user