You mean, something like this?
add_filter( 'comment_reply_link_args', 'change_author_title', 10, 2 );
function change_author_title( $args, $comment ) {
$args['reply_to_text'] = 'Reply to ' . get_comment_author( $comment );
return $args;
}
Explanation: I changed the function declaration so that it accepts the second parameter ($comment
) which is the comment object (a WP_Comment
instance), then I simply call the get_comment_author()
which fires the get_comment_author
hook. That way, your my_comment_author()
function would be called and then you’d get the same author name for use with the reply_to_text
arg.
Related Posts:
- How Does comment_author Filter Work?
- How to modify core when there is no hook?
- Remove Comment Author Link only for subscribers
- WordPress Internal @ Mentions
- Is it possible to filter comments in a post so a user can only see the comments they have written?
- Remove description from on Home
- How can I add an Author filter to the Media Library?
- Filter Widget Title Wrap
- Using filter to add additional fields to comment_form()
- Don’t replace “|” with Empty String (“”) when generating slugs from title
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- Alter only the page title, not the post titles within
- Am I using the right hook for removing quicktags on the admin TinyMCE?
- Changing document title only on a custom page template
- How to enable visual editor when editing comments on the dashboard?
- Filtering ‘the_title’ with option to return subhead?
- wp_title() empty on a static front page
- Can’t change the title tag with wp_title filter
- Setting title using wp_title filter
- How to link current user to their author page through shortcodes
- Add a Span Around a Product Title in WooCommerce [closed]
- Adding custom column to comments admin panel?
- Why anything done on comments_array hook gets reset?
- Wrap h1-h6 in a div
- Variables in post title
- How do I target a single page to modify the comment form of only that page?
- Is it possible to use multiple spaces in title?
- WP action/filter to modify title before header output and article output?
- How to validate recaptcha on comments form?
- changing font size and font of a custom message added after comment
- I want to allow the use of a data-flw attribute in links in comments
- Comment search plugin
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- Adding a filter to comments_template
- How to allow code block in wordpress comments
- Filter media upload attachment meta
- comment_for() Custom fields not visible when user is logged in
- Use has_filter on comment_post
- Filter page title (displayed in browser tab) of wp-login
- Remove comments validation (remove filter?)
- Strip $before & $after strings from a page title
- How do I add tags to entire comments, not just their text
- comment_notification_text filter not working
- Modify author url display in edit-comments.php
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- add_filter( ‘the_title’ gets through this if statement twice
- Filter Post Title without affecting screen-reader-text
- Modify WordPress Page Title ()
- How to filter page title for certain page?
- Author name length character limit?
- get_the_archive_title hook unwanted changes!
- Set post featured image to author image
- Converting restricted html in comments to bbcode
- Hide H1 Title using the_title filter
- Admin filter/error if post title is too long
- Auto append text after the title?
- Prevent 404 when using pre_get_posts to filter an archive page
- Hook added to the_content seems to be called multiple times
- How can I hide all posts that don’t have a thumbnail?
- Add comments meta fields to comments metabox on post edit screen
- Restrict filter to run only inside specific function
- How do I add a current class to the current post?
- Apply a filter only once
- Add a header before fields added with the attachment_fields_to_edit() filter
- How to edit dashboard search posts button texts for my CPT?
- When does a function assigned to the content_filtered_edit_pre filter hook fire?
- Capture post content before page renders
- Notification if Comment Author Field is left empty. E.g. change input border colour
- the_content filter together with require_once returns 1 instead of the content of the included file
- Restrict user role Author from viewing comments in admin interface
- Ajax submit comments
- Missing Argument 2 for apply_filter
- How to apply a filter to an ACF wysiwig editor field output?
- Is it possible to bind a function to a filter hook via Ajax?
- Using add_filter to prepend content, result is out of order
- get_posts() interrupt because of filter
- Disable sanitize_file_name on upload without modifying functions.php
- how to show comments only author which send own posts in wordpress
- How to modify image caption in posts?
- Extend Nonce Lifetime for Specific Nonce Creation
- reply comment below the comment box without reload page
- Consult array data in REST API Filter
- Custom permalink for attachment
- Overriding Generated Attachment Post URL
- Pagination while keeping the filters
- Filter on the day of the week from timestamp
- using filters on the function from class
- add_filter not adding the filter
- Adding restrictions to open comments
- Is this correct usage of filters in WordPress [closed]
- Passing variable from filter
- Filter posts by multiple checkbox categories
- Merge comments from Facebook with WP comments [closed]
- How to hide and disable URL and email fields from comments?
- Add a filter conditionally based on frontpage
- Using two posts_orderby add_filter makes conflict
- custom post filter based on Visitors country
- How to correctly override a filter?
- Is there a way to check if the ‘wp_sitemaps_enabled’ is true or false?
- Block Gutenberg Editor manually by User Roles with a Filter with code