Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#18451 closed enhancement (fixed)

Make charset_collate a public method on $wpdb

Reported by: simonwheatley Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Database Keywords: has-patch
Focuses: Cc:


I suggest adding a public charset_collate method on $wpdb. A small thing, but I'd reuse it all the time when adding tables in plugin code, which would save writing a lot of duplicate code.

Patch attached.

Attachments (2)

charset_collate method.diff (1.7 KB) - added by simonwheatley 4 years ago.
charset_collate method
charset-collate.diff (1.3 KB) - added by pento 3 years ago.

Download all attachments as: .zip

Change History (8)

4 years ago

charset_collate method

#1 @simonwheatley
4 years ago

(P.S. I thought I'd filed this ticket some time back, but couldn't find it when searching just now… apologies if I've re-created it, but I don't think I have.)

#2 @scribu
4 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to 3.3

Good idea.

#3 @ryan
4 years ago

  • Milestone changed from 3.3 to Future Release

Punting enhancements from 3.3.

#4 @pento
3 years ago

I'm cool with this. Updated the patch for trunk.

#5 @nacin
3 years ago

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

In [21471]:

Introduce wpdb::get_charset_collate() to return the DEFAULT CHARACTER SET and COLLATE for use in table schemas.

props simonwheatley, pento. fixes #18451.

#6 @nacin
3 years ago

  • Milestone changed from Future Release to 3.5

After discussion with pento, I decided to go with get_charset_collate() for clarity.

Note: See TracTickets for help on using tickets.