Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 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 6 years ago.
21201.2.diff (612 bytes) - added by SergeyBiryukov 6 years ago.
Adjusted PHPDocs

Download all attachments as: .zip

Change History (7)

6 years ago

6 years ago

Adjusted PHPDocs

#1 @wonderboymusic
6 years ago

  • Milestone changed from Awaiting Review to 3.5

#2 @DrewAPicture
6 years ago

  • Keywords punt added; has-patch removed

#3 @DrewAPicture
6 years ago

  • Keywords has-patch added

#4 @nacin
6 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.

#5 @nacin
6 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.