From 061bfddda94b15c90d9c268e7014acdcc11909d2 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 20 Dec 2014 23:27:00 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@30984 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-wp-comments-list-table.php | 18 ++++++++---------- src/wp-admin/includes/class-wp-list-table.php | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 3814f98bcf..73e5c82418 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -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 ''; comment_text(); - if ( $user_can ) { ?> + if ( $this->user_can ) { ?>