comment_type, $args['callback'] ) ) { $callback = $args['callback'][ $comment->comment_type ]; } elseif ( array_key_exists( 'all', $args['callback'] ) ) { $callback = $args['callback']['all']; } } if ( $callback ) { ob_start(); call_user_func( $callback, $comment, $args, $depth ); $output .= ob_get_clean(); return; } } $defaults = array( 'avatar_only' => false, // Implements an argument that will just output an avatar 'overlay' => self::get_overlay_default(), // Implements an argument that optionally overlays an icon on top of the profile image, applies only to the avatar only output ); $args = wp_parse_args( $args, $defaults ); if ( 'comment' === $comment->comment_type ) { add_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40, 2 ); } // Maintain the original pingback and trackback output. if ( ( 'pingback' === $comment->comment_type || 'trackback' === $comment->comment_type ) && $args['short_ping'] ) { ob_start(); $this->ping( $comment, $depth, $args ); $output .= ob_get_clean(); } elseif ( $args['avatar_only'] ) { ob_start(); $this->avatar_only( $comment, $depth, $args ); $output .= ob_get_clean(); } elseif ( 'html5' === $args['format'] ) { ob_start(); $this->html5_comment( $comment, $depth, $args ); $output .= ob_get_clean(); } else { ob_start(); $this->comment( $comment, $depth, $args ); $output .= ob_get_clean(); } if ( 'comment' === $comment->comment_type ) { remove_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40 ); } } /** * Outputs a comment as just a profile picture. * * @param WP_Comment $comment The comment object. * @param int $depth Depth of the current comment. * @param array $args An array of arguments. */ protected function avatar_only( $comment, $depth, $args ) { $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; $title = get_comment_text( $comment, $args ); // Optionally overlay an icon. $overlay = ''; if ( $args['overlay'] ) { $overlay = '
'; } ?> < id="comment-" comment_type, 'class' ), 'h-cite', 'avatar-only' ), $comment ); ?>>