Make WordPress Core

Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#55977 closed defect (bug) (fixed)

Fix doc block for do_action

Reported by: leogermani's profile leogermani Owned by: audrasjb's profile audrasjb
Milestone: 6.1 Priority: normal
Severity: trivial Version:
Component: General Keywords: good-first-bug has-patch commit
Focuses: docs Cc:

Description

The code example in the do_action function code block assigns the return of the do_action call to a variable, even though do_action does not return anything.

Code: https://core.trac.wordpress.org/browser/tags/6.0/src/wp-includes/plugin.php#L427

As reported here: https://developer.wordpress.org/reference/functions/do_action/#comment-5351

Attachments (1)

55977.patch (696 bytes) - added by thakkarhardik 2 years ago.

Download all attachments as: .zip

Change History (9)

This ticket was mentioned in Slack in #docs by leogermani. View the logs.


2 years ago

#2 @johnbillion
2 years ago

  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to 6.1

#3 @thakkarhardik
2 years ago

  • Keywords has-patch added; needs-patch removed

I have removed the do_action return variable from the doc block and attached the patch.

@thakkarhardik
2 years ago

This ticket was mentioned in PR #2816 on WordPress/wordpress-develop by dknauss.


2 years ago
#4

The example code block shows the do_action() call returning a value, but the function has no return value.

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

#5 @audrasjb
23 months ago

  • Owner changed from leogermani to audrasjb
  • Status changed from assigned to reviewing
  • Version 6.0 deleted

Hello, thanks for spotting this and for the patch,

Self assigning for review/commit.

#6 @audrasjb
23 months ago

  • Keywords commit added
  • Status changed from reviewing to accepted

#7 @audrasjb
23 months ago

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

In 53748:

Docs: Update do_action() docblock code example.

This changeset fixes an issue with the code example provided: do_action() doesn't return any value.

Props leogermani, thakkarhardik.
Fixes #55977.

Note: See TracTickets for help on using tickets.