mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-08 16:41:44 +01:00
Add the floated_admin_avatar filter from WP_Comments_Table. See #14637
git-svn-id: http://svn.automattic.com/wordpress/trunk@15512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d61363d755
commit
1b2fa98e2a
@ -632,9 +632,6 @@ case 'add-comment' :
|
|||||||
if ( !$table->has_items() )
|
if ( !$table->has_items() )
|
||||||
die('1');
|
die('1');
|
||||||
|
|
||||||
if ( get_option('show_avatars') )
|
|
||||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
|
||||||
|
|
||||||
$x = new WP_Ajax_Response();
|
$x = new WP_Ajax_Response();
|
||||||
foreach ( $table->items as $comment ) {
|
foreach ( $table->items as $comment ) {
|
||||||
get_comment( $comment );
|
get_comment( $comment );
|
||||||
@ -727,9 +724,6 @@ case 'replyto-comment' :
|
|||||||
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
|
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
|
||||||
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
||||||
|
|
||||||
if ( get_option('show_avatars') && 'single' != $mode )
|
|
||||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
|
||||||
|
|
||||||
$x = new WP_Ajax_Response();
|
$x = new WP_Ajax_Response();
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
@ -770,9 +764,6 @@ case 'edit-comment' :
|
|||||||
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
||||||
$comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
|
$comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
|
||||||
|
|
||||||
if ( get_option('show_avatars') && 'single' != $mode )
|
|
||||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
|
||||||
|
|
||||||
require_once( './includes/default-list-tables.php' );
|
require_once( './includes/default-list-tables.php' );
|
||||||
$table = new WP_Comments_Table();
|
$table = new WP_Comments_Table();
|
||||||
|
|
||||||
|
@ -158,10 +158,4 @@ function enqueue_comment_hotkeys_js() {
|
|||||||
if ( 'true' == get_user_option( 'comment_shortcuts' ) )
|
if ( 'true' == get_user_option( 'comment_shortcuts' ) )
|
||||||
wp_enqueue_script( 'jquery-table-hotkeys' );
|
wp_enqueue_script( 'jquery-table-hotkeys' );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_admin() && isset($pagenow) && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) {
|
|
||||||
if ( get_option('show_avatars') )
|
|
||||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -1929,6 +1929,13 @@ class WP_Users_Table extends WP_List_Table {
|
|||||||
class WP_Comments_Table extends WP_List_Table {
|
class WP_Comments_Table extends WP_List_Table {
|
||||||
|
|
||||||
function WP_Comments_Table() {
|
function WP_Comments_Table() {
|
||||||
|
global $mode;
|
||||||
|
|
||||||
|
$mode = ( empty( $_REQUEST['mode'] ) ) ? 'detail' : $_REQUEST['mode'];
|
||||||
|
|
||||||
|
if ( get_option('show_avatars') && 'single' != $mode )
|
||||||
|
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||||
|
|
||||||
parent::WP_List_Table( array(
|
parent::WP_List_Table( array(
|
||||||
'screen' => 'edit-comments',
|
'screen' => 'edit-comments',
|
||||||
'plural' => 'comments'
|
'plural' => 'comments'
|
||||||
@ -1941,12 +1948,10 @@ class WP_Comments_Table extends WP_List_Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function prepare_items() {
|
function prepare_items() {
|
||||||
global $post_id, $comment_status, $mode, $search;
|
global $post_id, $comment_status, $search;
|
||||||
|
|
||||||
$post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
|
$post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
|
||||||
|
|
||||||
$mode = ( empty( $_REQUEST['mode'] ) ) ? 'detail' : $_REQUEST['mode'];
|
|
||||||
|
|
||||||
$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
|
$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
|
||||||
if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )
|
if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )
|
||||||
$comment_status = 'all';
|
$comment_status = 'all';
|
||||||
|
Loading…
Reference in New Issue
Block a user