WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#47810 closed defect (bug) (fixed)

Incorrect PHPDoc for hooks quick_edit_custom_box and bulk_edit_custom_box

Reported by: abrain Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: minor Version: 5.3
Component: Quick/Bulk Edit Keywords:
Focuses: docs Cc:

Description

The PHPDoc for the hook quick_edit_custom_box is missing the $ in front of the parameter taxonomy. This causes the Code Reference page to omit the parameter name.

/**
 * Fires once for each column in Quick Edit mode.
 *
 * @since 2.7.0
 *
 * @param string $column_name Name of the column to edit.
 * @param string $post_type   The post type slug, or current screen name if this is a taxonomy list table.
 * @param string taxonomy     The taxonomy name, if any.
 */

A few lines further up, the PHPDoc for the hook bulk_edit_custom_box states that the parameter $post_type is of type WP_Post.

/**
 * Fires once for each column in Bulk Edit mode.
 *
 * @since 2.7.0
 *
 * @param string  $column_name Name of the column to edit.
 * @param WP_Post $post_type   The post type slug.
 */

As this parameter is filled with WP_Screen's $post_type property which is a string, it should also be documented as a string.

Attachments (2)

code-reference.png (25.6 KB) - added by abrain 8 months ago.
Code Reference page with missing parameter name
47810.diff (1.0 KB) - added by abrain 8 months ago.

Download all attachments as: .zip

Change History (4)

@abrain
8 months ago

Code Reference page with missing parameter name

@abrain
8 months ago

#1 @SergeyBiryukov
8 months ago

  • Milestone changed from Awaiting Review to 5.3
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#2 @SergeyBiryukov
8 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 45704:

Docs: Correct parameter documentation for bulk_edit_custom_box and quick_edit_custom_box actions.

Props abrain.
Fixes #47810.

Note: See TracTickets for help on using tickets.