[wp-trac] [WordPress Trac] #22889: Reconsider no-JS ?replytocom= links

WordPress Trac noreply at wordpress.org
Mon Jul 9 14:47:31 UTC 2018


#22889: Reconsider no-JS ?replytocom= links
------------------------------------------+-----------------------------
 Reporter:  markjaquith                   |       Owner:  SergeyBiryukov
     Type:  enhancement                   |      Status:  accepted
 Priority:  normal                        |   Milestone:  5.0
Component:  Comments                      |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  has-patch dev-feedback close  |     Focuses:
------------------------------------------+-----------------------------

Comment (by juslintek):

 After removing it commentator specified 'Reply to %s' message doesn't work
 anymore:
 site/web/wp/wp-includes/comment-template.php:1850
 {{{#!php
 <?php
 /**
  * Display text based on comment reply status.
  *
  * Only affects users with JavaScript disabled.
  *
  * @internal The $comment global must be present to allow template tags
 access to the current
  *           comment. See https://core.trac.wordpress.org/changeset/36512.
  *
  * @since 2.7.0
  *
  * @global WP_Comment $comment Current comment.
  *
  * @param string $noreplytext  Optional. Text to display when not replying
 to a comment.
  *                             Default false.
  * @param string $replytext    Optional. Text to display when replying to
 a comment.
  *                             Default false. Accepts "%s" for the author
 of the comment
  *                             being replied to.
  * @param string $linktoparent Optional. Boolean to control making the
 author's name a link
  *                             to their comment. Default true.
  */
 function comment_form_title( $noreplytext = false, $replytext = false,
 $linktoparent = true ) {
         global $comment;

         if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply'
 );
         if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s'
 );

         $replytoid = isset($_GET['replytocom']) ? (int)
 $_GET['replytocom'] : 0;

         if ( 0 == $replytoid )
                 echo $noreplytext;
         else {
                 // Sets the global so that template tags can be used in
 the comment form.
                 $comment = get_comment($replytoid);
                 $author = ( $linktoparent ) ? '<a href="#comment-' .
 get_comment_ID() . '">' . get_comment_author( $comment ) . '</a>' :
 get_comment_author( $comment );
                 printf( $replytext, $author );
         }
 }
 }}}

 Haven't figure it out yet, how to pass this variable via ajax. Any non-
 hardcore hacks anyone come up regarding this?

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


More information about the wp-trac mailing list