Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#28388 closed defect (bug) (fixed)

Optional $post and $post_id should be documented as such

Reported by: drewapicture's profile DrewAPicture Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: docs Cc:

Description

In [25567] some usage of $post_id and/or $post were un-marked as optional as they rely on the post global.

These (and others in core) need to be marked as optional, also notating that they default to the post global via get_post() where applicable.

Related-ish: #20495

Change History (7)

#1 @DrewAPicture
11 years ago

Looks like [28653] missed posting. It handled properly documenting $post as optional where applicable.

#2 @DrewAPicture
11 years ago

In 28654:

Ensure $post_id is documented as optional where applicable.

See #28388.

#3 @DrewAPicture
11 years ago

In 28655:

Be more specific that $post_id does not default to the ID of the global $post in some cases.

See [28654]. See #28388.

#4 @wonderboymusic
10 years ago

  • Keywords needs-patch added

#5 @DrewAPicture
10 years ago

In 28975:

Fix an incomplete docblock for wp_create_categories() as part of $post/$post_id cleanup.

See #28388.

#6 @DrewAPicture
10 years ago

In 28976:

Remove backticks on $post variables in some short parameter descriptions.

See [28653], [28654].
See #28388.

#7 @DrewAPicture
10 years ago

  • Keywords needs-patch removed
  • Resolution set to fixed
  • Status changed from new to closed

That should cover it for now. Any others we can get in the full file audits.

Note: See TracTickets for help on using tickets.