Skip to content

Commit 1641249

Browse files
Coding Standards: Explicitly return null in get_comment_reply_link().
This matches the documented `@return` type. Includes correcting documentation for `get_post_reply_link()`, which can only return `string` or `false`. Follow-up to [8898], [8970], [9406], [25567], [30681], [32568], [45741], [46335]. Props justlevine. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60397 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a27baba commit 1641249

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/wp-includes/comment-template.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c
17541754
* @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment.
17551755
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
17561756
* Default current post.
1757-
* @return string|false|null Link to show comment form, if successful. False, if comments are closed.
1757+
* @return string|false|null Link to show comment form on success. False if comments are closed. Null on failure.
17581758
*/
17591759
function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
17601760
$defaults = array(
@@ -1777,13 +1777,13 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null
17771777
$args['depth'] = (int) $args['depth'];
17781778

17791779
if ( 0 === $args['depth'] || $args['max_depth'] <= $args['depth'] ) {
1780-
return;
1780+
return null;
17811781
}
17821782

17831783
$comment = get_comment( $comment );
17841784

17851785
if ( empty( $comment ) ) {
1786-
return;
1786+
return null;
17871787
}
17881788

17891789
if ( empty( $post ) ) {
@@ -1911,9 +1911,9 @@ function comment_reply_link( $args = array(), $comment = null, $post = null ) {
19111911
* @type string $before Text or HTML to add before the reply link. Default empty.
19121912
* @type string $after Text or HTML to add after the reply link. Default empty.
19131913
* }
1914-
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
1915-
* Default current post.
1916-
* @return string|false|null Link to show comment form, if successful. False, if comments are closed.
1914+
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
1915+
* Default current post.
1916+
* @return string|false Link to show comment form on success. False if comments are closed.
19171917
*/
19181918
function get_post_reply_link( $args = array(), $post = null ) {
19191919
$defaults = array(

0 commit comments

Comments
 (0)