How to change the "...
 
Share:
Notifications
Clear all

[Solved] How to change the "Author" Label for Administrators

1 Posts
1 Users
0 Likes
956 Views
Asti
 Asti
(@asti)
Illustrious Member Support
Joined: 6 years ago
Posts: 6987
Topic starter  

Let's say the Post Author is also the Administrator of the website. In this case, in the comment section, the user will have an "Author" label when he/she leaves a comment. 

image

To change the label you should use the hook code below:

add_filter("wpdiscuz_author_title", function ($label, $comment) {
    global $post;
    if ($comment->user_id == $post->post_author) {
        $label = __("Administrator", "wpdiscuz");
    }
    return $label;
}, 10, 2);

Put the code in the active theme functions.php file. This article should be helpful for you:  https://themaverickspirit.com/add-code-snippets-functions-php-wordpress/

The red-marked phrase can be changed as you like.   

In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.


   
Share: