Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#50277 closed defect (bug) (fixed)

get_category_by_slug() lacked bool return type

Reported by: stevenlinx's profile stevenlinx Owned by: sergeybiryukov's profile 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 4 years ago.

Download all attachments as: .zip

Change History (4)

@stevenlinx
4 years ago

#1 @stevenlinx
4 years ago

  • Keywords has-patch added; needs-docs removed

#2 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.5

#3 @SergeyBiryukov
4 years 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.