Make WordPress Core

Changeset 60397


Ignore:
Timestamp:
06/30/2025 05:39:28 PM (9 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r60304 r60397  
    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 */
    17591759function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
     
    17781778
    17791779    if ( 0 === $args['depth'] || $args['max_depth'] <= $args['depth'] ) {
    1780         return;
     1780        return null;
    17811781    }
    17821782
     
    17841784
    17851785    if ( empty( $comment ) ) {
    1786         return;
     1786        return null;
    17871787    }
    17881788
     
    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 */
    19181918function get_post_reply_link( $args = array(), $post = null ) {
Note: See TracChangeset for help on using the changeset viewer.