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 = '' . get_webmention_comment_type_attr( $comment->comment_type, 'icon' ) . ''; } ?> < id="comment-" comment_type, 'class' ), 'h-cite', 'avatar-only' ), $comment ); ?>>
comment_ID, 'protocol', true ) ) { parent::html5_comment( $comment, $depth, $args ); return; } $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; $cite = apply_filters( 'webmention_cite', ' @ %2s' ); $url = get_url_from_webmention( $comment ); $host = wp_parse_url( $url, PHP_URL_HOST ); $host = preg_replace( '/^www\./', '', $host ); $type = get_webmention_comment_type_attr( $comment->comment_type, 'class' ); if ( 'comment' === $comment->comment_type ) { $type = 'p-comment'; } $commenter = wp_get_current_commenter(); $show_pending_links = ! empty( $commenter['comment_author'] ); if ( $commenter['comment_author_email'] ) { $moderation_note = __( 'Your comment is awaiting moderation.', 'default' ); } else { $moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.', 'default' ); } ?> < id="comment-" has_children ? 'parent' : '', $comment ); ?>>
comment_approved || $show_pending_links ) { comment_reply_link( array_merge( $args, array( 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '
', 'after' => '
', ) ) ); } ?>
query_vars['meta_query'] ) ) { $query_vars = current( $query->query_vars['meta_query'] ); if ( ! empty( $query_vars['key'] ) && 'protocol' === $query_vars['key'] ) { return; } } if ( isset( $query->query_vars['count'] ) && true === $query->query_vars['count'] ) { return; } // Exclude likes and reposts by the Webmention plugin. $query->query_vars['type__not_in'] = get_webmention_comment_type_names(); } }