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?
- Remove rel=”ugc” from links in comments
- How to increase comment length?
- How to add placeholder into comment form textarea?
- Post filter Month dropdown at front-end like wordpress backend
- Password protected Page add_filter to change the text doesn’t work
- wp_editor customization
- wordpress filtering out caps in wp_title? (UpperCase is changed to Uppercase)
- What problems could happen if I replaced add_filter and add_action with the function calling
- How to check which submission button was clicked?
- shortcode function outputs multiple anchor tags
- Restrict access to custom post type and filter from every query
- check, if any “add_action” function contains string XXXXXXXXX
- Comment section not appearing on posts
- What is the proper/best way to have multiple add_filter for wp-job-manager-resume
- What scope is $blog_url = get_bloginfo() inside a function
- Why none of xmlrpc filters work
- Prevent author from editing comments from others in their post
- Modify WooCommerce email shipping text value
- WP REST API v2. filters doesn’t work
- How to get to the date of the uploaded file
- How to add more than one custom metadata as filter on the post list page?
- Echo out custom fields in comments
- reply to comment excerpt instead of author in comment title
- How to use a TinyMCE filter?
- apply_filters to $GLOBALS
- Unable to get WordPress’s apply_filters(‘site_url’) to return a https scheme
- changing size image within the content
- Publish button inside custom field group
- Get Commentor IP When Marking Comment As Spam
- How to filter content in Dashboard?
- String Replace Caching & Chance of Collisions
- Change shortcode output (filter?)
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- posts_results filter function memory errors
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- Jetpack Comments Change Placeholder Text
- Show child theme for users on specific IP
- How to replace all images in all posts and pages with a different size?
- How to use the filter ‘widget_text’ to a particular text widget with id
- How to filter posts in admin by before date or by post status ‘future’?
- How to change comment-page-1#comment-25 to any string?
- Using Filters To Change Page Title
- Remove action added from class
- The title of an attachment is not working