Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#58043 closed defect (bug) (fixed)

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

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

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.


4 years 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
4 years ago

  • Component General → Media
  • Milestone Awaiting Review → 6.3

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

#3 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → 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.