[wp-trac] [WordPress Trac] #58604: title_reply_to Value of comment_form() Function Isn't Working

WordPress Trac noreply at wordpress.org
Wed Jul 16 16:17:21 UTC 2025


#58604: title_reply_to Value of comment_form() Function Isn't Working
-------------------------------+------------------------------
 Reporter:  metinmete          |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Comments           |     Version:  6.2.2
 Severity:  major              |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by salvatorenoschese):

 Same here, ATM I use this
 {{{#!php
 <?php
 // Personalizza titolo e link del modulo commenti in WordPress
 add_filter('comment_form_defaults', function($defaults) {
     $defaults['title_reply'] = 'Aggiungi un commento 👍';
     $defaults['title_reply_before'] = '<h2 id="reply-title" class
 ="comment-reply-title">';
     $defaults['title_reply_after'] = '</h2>';
     return $defaults;
 });

 // Modifica il link "Rispondi" con @Nome, anche nel data-replyto e aria-
 label
 add_filter('comment_reply_link', function ($link, $args, $comment, $post)
 {
     $author = get_comment_author($comment);
     $mention = esc_html('@' . $author);

     // Sostituisce: testo visibile, data-replyto e aria-label
     $link = preg_replace('/>[^<]+</', '>' . $mention . '<', $link);
     $link = preg_replace('/data-replyto="[^"]+"/', 'data-replyto="' .
 $mention . '"', $link);
     $link = preg_replace('/aria-label="[^"]+"/', 'aria-label="' . $mention
 . '"', $link);

     return $link;
 }, 10, 4);
 }}}

 And work as expected. Idk why title_reply_to not work at all.

 WP 6.8.2, Theme twenty twenty five.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58604#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list