WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#7609 closed defect (bug) (fixed)

Use forward compatible $wpdb->has_cap() instead of $wpdb->one_off_function()

Reported by: mdawaffe Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.7
Component: General Keywords:
Focuses: Cc:

Description

WP now has two "can the database do X?" functions in WPDB: $wpdb->supports_collation() and $wpdb->supports_subqueries().

Attached adds a more generice $wpdb->has_cap( $cap ) that we can add to over time as needed. Since the function returns false by default, it's forward compatible for plugins.

Taken from HyperDB and BackPress. If we want to call it something else ($wpdb->supports( $cap ) or something), we probably can.

Attachments (1)

7609.diff (2.6 KB) - added by mdawaffe 10 years ago.

Download all attachments as: .zip

Change History (2)

@mdawaffe
10 years ago

#1 @ryan
10 years ago

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

(In [8740]) wpdb::has_cap() from mdawaffe. fixes #7609

Note: See TracTickets for help on using tickets.