WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 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:

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 3 years ago.
charset_collate method
charset-collate.diff (1.3 KB) - added by pento 2 years ago.

Download all attachments as: .zip

Change History (8)

simonwheatley3 years ago

charset_collate method

comment:1 simonwheatley3 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.)

comment:2 scribu3 years ago

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

Good idea.

comment:3 ryan3 years ago

  • Milestone changed from 3.3 to Future Release

Punting enhancements from 3.3.

pento2 years ago

comment:4 pento2 years ago

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

comment:5 nacin2 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.

comment:6 nacin2 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.