Opened 21 months ago

Closed 10 months ago

Last modified 10 months ago

#18451 closed enhancement (fixed)

Make charset_collate a public method on $wpdb

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

Description

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 21 months ago.
charset_collate method
charset-collate.diff (1.3 KB) - added by pento 10 months ago.

Download all attachments as: .zip

Change History (8)

charset_collate method

(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.)

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

Good idea.

  • Milestone changed from 3.3 to Future Release

Punting enhancements from 3.3.

pento10 months ago

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

  • 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.

  • 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.