Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#21201 closed defect (bug) (fixed)

get_cat_ID(): category "General" does not exist anymore by default

Reported by: Latz Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.4.1
Component: Taxonomy Keywords: has-patch
Focuses: Cc:


a) The function "get_cat_ID()" (category.php) assumes that there is a category "General" created on installation. Since version 2.0(?) this category has been renamed to "Uncategorized".

b) Returning the ID of a default category does not make any sense.

Attachments (2)

21201.diff (598 bytes) - added by Latz 3 years ago.
21201.2.diff (612 bytes) - added by SergeyBiryukov 3 years ago.
Adjusted PHPDocs

Download all attachments as: .zip

Change History (7)

@Latz3 years ago

@SergeyBiryukov3 years ago

Adjusted PHPDocs

comment:1 @wonderboymusic3 years ago

  • Milestone changed from Awaiting Review to 3.5

comment:2 @DrewAPicture2 years ago

  • Keywords punt added; has-patch removed

comment:3 @DrewAPicture2 years ago

  • Keywords has-patch added

comment:4 @nacin2 years ago

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

In [22260]:

Remove bogus optional value for get_cat_ID(). (Incorrect usage will result in a warning.) props Latz. fixes #21201.

comment:5 @nacin2 years ago

  • Keywords punt removed

If we get more than a report or two of E_WARNINGs for improper uses of this function (probably a theme using the wrong function), we can convert that to defaulting to null, and then bail if null, to sidestep the warning.

Note: See TracTickets for help on using tickets.