文件操作 - author-badge.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/comments/author-badge.php
编辑文件内容
<?php namespace TotalTheme\Comments; \defined( 'ABSPATH' ) || exit; /** * Adds comment author badges. */ class Author_Badge { /** * The post types to insert the comment author badge to. */ protected $post_types = [ 'post' ]; /** * Constructor. */ public function __construct() { \add_filter( 'get_comment_author', [ $this, 'modify_comment_author' ], 10, 2 ); } /** * Hooks into the get_comment_author hook. */ public function modify_comment_author( $author, $comment_id ) { $post = \get_post(); $comment = \get_comment( $comment_id ); if ( ! $comment || ! $post ) { return $author; } $supported_types = \apply_filters( 'wpex_comment_author_badge_supported_post_types', $this->post_types ); if ( $comment->user_id === $post->post_author && \in_array( $post->post_type, $supported_types ) ) { $author .= '<span class="wpex-badge wpex-ml-5">' . \esc_html__( 'Author', 'total' ) . '</span>'; } return $author; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件