Skip to content

Commit 316da06

Browse files
SergeyBiryukovSergeyBiryukov
authored andcommitted
Docs: Correct parameter and return types for some comment functions.
This commit corrects some parameter type issues concerning arrays. More specifically: * `separate_comments()` now correctly indicates that it returns an array of `WP_Comment` objects, keyed by their string types. * `_close_comments_for_old_posts()` now correctly indicates that it both takes and returns an array of `WP_Post` objects. Follow-up to [8892], [8897], [8949], [32587], [42876]. Props justlevine, johnbillion. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60330 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ebace79 commit 316da06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wp-includes/comment.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,8 @@ function wp_check_comment_flood( $is_flood, $ip, $email, $date, $avoid_die = fal
932932
*
933933
* @since 2.7.0
934934
*
935-
* @param WP_Comment[] $comments Array of comments
936-
* @return WP_Comment[] Array of comments keyed by comment_type.
935+
* @param WP_Comment[] $comments Array of comments.
936+
* @return array<string, WP_Comment[]> Array of comments keyed by comment type.
937937
*/
938938
function separate_comments( &$comments ) {
939939
$comments_by_type = array(
@@ -3436,9 +3436,9 @@ function _prime_comment_caches( $comment_ids, $update_meta_cache = true ) {
34363436
* @since 2.7.0
34373437
* @access private
34383438
*
3439-
* @param WP_Post $posts Post data object.
3440-
* @param WP_Query $query Query object.
3441-
* @return array
3439+
* @param WP_Post[] $posts Array of post objects.
3440+
* @param WP_Query $query Query object.
3441+
* @return WP_Post[]
34423442
*/
34433443
function _close_comments_for_old_posts( $posts, $query ) {
34443444
if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) ) {

0 commit comments

Comments
 (0)