Changeset 48579
- Timestamp:
- 07/23/2020 01:32:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r48577 r48579 1920 1920 } 1921 1921 1922 $reply toid = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;1923 $result = "<input type='hidden' name='comment_post_ID' value='$post_id' id='comment_post_ID' />\n";1924 $result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";1922 $reply_to_id = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0; 1923 $result = "<input type='hidden' name='comment_post_ID' value='$post_id' id='comment_post_ID' />\n"; 1924 $result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$reply_to_id' />\n"; 1925 1925 1926 1926 /** … … 1929 1929 * @since 3.0.0 1930 1930 * 1931 * @param string $result The HTML-formatted hidden ID field comment elements.1932 * @param int $post_id The post ID.1933 * @param int $reply toid The ID of the comment being replied to.1934 */ 1935 return apply_filters( 'comment_id_fields', $result, $post_id, $reply toid );1931 * @param string $result The HTML-formatted hidden ID field comment elements. 1932 * @param int $post_id The post ID. 1933 * @param int $reply_to_id The ID of the comment being replied to. 1934 */ 1935 return apply_filters( 'comment_id_fields', $result, $post_id, $reply_to_id ); 1936 1936 } 1937 1937 … … 1966 1966 * @global WP_Comment $comment Global comment object. 1967 1967 * 1968 * @param string $no replytext Optional. Text to display when not replying to a comment.1969 * Default false.1970 * @param string $reply textOptional. Text to display when replying to a comment.1971 * Default false. Accepts "%s" for the author of the comment1972 * being replied to.1973 * @param string $link toparent Optional. Boolean to control making the author's name a link1974 * to their comment. Default true.1975 */ 1976 function comment_form_title( $no replytext = false, $replytext = false, $linktoparent = true ) {1968 * @param string $no_reply_text Optional. Text to display when not replying to a comment. 1969 * Default false. 1970 * @param string $reply_text Optional. Text to display when replying to a comment. 1971 * Default false. Accepts "%s" for the author of the comment 1972 * being replied to. 1973 * @param string $link_to_parent Optional. Boolean to control making the author's name a link 1974 * to their comment. Default true. 1975 */ 1976 function comment_form_title( $no_reply_text = false, $reply_text = false, $link_to_parent = true ) { 1977 1977 global $comment; 1978 1978 1979 if ( false === $noreplytext ) { 1980 $noreplytext = __( 'Leave a Reply' ); 1981 } 1982 if ( false === $replytext ) { 1979 if ( false === $no_reply_text ) { 1980 $no_reply_text = __( 'Leave a Reply' ); 1981 } 1982 1983 if ( false === $reply_text ) { 1983 1984 /* translators: %s: Author of the comment being replied to. */ 1984 $reply text = __( 'Leave a Reply to %s' );1985 } 1986 1987 $reply toid = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;1988 1989 if ( 0 == $reply toid ) {1990 echo $no replytext;1985 $reply_text = __( 'Leave a Reply to %s' ); 1986 } 1987 1988 $reply_to_id = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0; 1989 1990 if ( 0 == $reply_to_id ) { 1991 echo $no_reply_text; 1991 1992 } else { 1992 1993 // Sets the global so that template tags can be used in the comment form. 1993 $comment = get_comment( $replytoid ); 1994 $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author( $comment ) . '</a>' : get_comment_author( $comment ); 1995 printf( $replytext, $author ); 1994 $comment = get_comment( $reply_to_id ); 1995 1996 if ( $link_to_parent ) { 1997 $author = '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author( $comment ) . '</a>'; 1998 } else { 1999 $author = get_comment_author( $comment ); 2000 } 2001 2002 printf( $reply_text, $author ); 1996 2003 } 1997 2004 }
Note: See TracChangeset
for help on using the changeset viewer.