Commit 3a45102a16 for wordpress.org

commit 3a45102a1619379945d6029699fe63b7b0406ad7
Author: Sergey Biryukov <sergeybiryukov.ru@gmail.com>
Date:   Mon Jun 30 17:41:28 2025 +0000

    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.
    Built from https://develop.svn.wordpress.org/trunk@60397


    git-svn-id: http://core.svn.wordpress.org/trunk@59733 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index f023c03cd0..f74249c81b 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -1754,7 +1754,7 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c
  * @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment.
  * @param int|WP_Post    $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
  *                                Default current post.
- * @return string|false|null Link to show comment form, if successful. False, if comments are closed.
+ * @return string|false|null Link to show comment form on success. False if comments are closed. Null on failure.
  */
 function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
 	$defaults = array(
@@ -1777,13 +1777,13 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null
 	$args['depth']     = (int) $args['depth'];

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

 	$comment = get_comment( $comment );

 	if ( empty( $comment ) ) {
-		return;
+		return null;
 	}

 	if ( empty( $post ) ) {
@@ -1911,9 +1911,9 @@ function comment_reply_link( $args = array(), $comment = null, $post = null ) {
  *     @type string $before     Text or HTML to add before the reply link. Default empty.
  *     @type string $after      Text or HTML to add after the reply link. Default empty.
  * }
- * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
- *                             Default current post.
- * @return string|false|null Link to show comment form, if successful. False, if comments are closed.
+ * @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
+ *                          Default current post.
+ * @return string|false Link to show comment form on success. False if comments are closed.
  */
 function get_post_reply_link( $args = array(), $post = null ) {
 	$defaults = array(
diff --git a/wp-includes/version.php b/wp-includes/version.php
index ae84724d91..4ecf00108b 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '6.9-alpha-60368';
+$wp_version = '6.9-alpha-60397';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.