WordPress.org

Make WordPress Core

#50277 closed defect (bug) (fixed)

get_category_by_slug() lacked bool return type

Reported by: stevenlinx Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch
Focuses: docs Cc:

Description

The return type should be either object or bool.

get_category_by_slug() | Codex:
https://codex.wordpress.org/Function_Reference/get_category_by_slug

get_category_by_slug() | DevHub:
https://developer.wordpress.org/reference/functions/get_category_by_slug/

Attachments (1)

50277.diff (552 bytes) - added by stevenlinx 13 months ago.

Download all attachments as: .zip

Change History (4)

@stevenlinx
13 months ago

#1 @stevenlinx
13 months ago

  • Keywords has-patch added; needs-docs removed

#2 @SergeyBiryukov
13 months ago

  • Milestone changed from Awaiting Review to 5.5

#3 @SergeyBiryukov
13 months ago

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

In 47863:

Docs: Document that get_category_by_slug() returns false if the category doesn't exist.

Props stevenlinx.
Fixes #50277.

Note: See TracTickets for help on using tickets.