Make WordPress Core

#58043 closed defect (bug) (fixed)

Mention Default Value at comment for $parent_post_id Param in wp_insert_attachment() Function

Reported by: wpfy's profile wpfy Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.3 Priority: normal
Severity: normal Version: 6.3
Component: Media Keywords: has-patch
Focuses: coding-standards Cc:

Description

In the WordPress core file, /wp-includes/post.php, on line 6310, there is a missing default value for the $parent_post_id parameter in the wp_insert_attachment() function. The $parent_post_id parameter is optional and is used to specify the ID of the parent post for the current post being inserted. However, the current documentation does not include a default value for this parameter in the comment.

Change History (3)

This ticket was mentioned in PR #4279 on WordPress/wordpress-develop by @wpfy.


16 months ago
#1

  • Keywords has-patch added; needs-patch removed

In the WordPress core file, /wp-includes/post.php, on line 6310, there is a missing default value for the $parent_post_id parameter in the wp_insert_attachment() function. The $parent_post_id parameter is optional and is used to specify the ID of the parent post for the current post being inserted. However, the current documentation does not include a default value for this parameter in the comment.

Trac ticket: https://core.trac.wordpress.org/ticket/58043

#2 @SergeyBiryukov
16 months ago

  • Component changed from General to Media
  • Milestone changed from Awaiting Review to 6.3

Hi there, welcome to WordPress Trac! Thanks for the ticket.

#3 @SergeyBiryukov
16 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 55617:

Docs: Document default values for optional parameters in wp_insert_attachment().

This adds the missing mentions of default value for the $file and $parent_post_id parameters.

Follow-up to [2921], [3092], [3303], [3851], [6155], [6379], [8669], [15590], [28788], [38408], [49936], [55021].

Props wpfy.
Fixes #58043.

Note: See TracTickets for help on using tickets.