[wp-trac] [WordPress Trac] #19019: Reduce duplication in $wpdb

WordPress Trac noreply at wordpress.org
Fri Sep 20 20:27:42 UTC 2013


#19019: Reduce duplication in $wpdb
-------------------------------------+-----------------------------
 Reporter:  scribu                   |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Database                 |     Version:
 Severity:  minor                    |  Resolution:
 Keywords:  needs-refresh 3.7-early  |
-------------------------------------+-----------------------------
Changes (by nacin):

 * milestone:  3.7 => Future Release


Comment:

 Replying to [comment:10 nacin]:
 > I think this is slightly over-abstracted. _insert_replace_helper is the
 only situation where we need values only. Let's keep that logic there,
 then have the new helper function drop the $values aspect. This would
 still then abstract out update() and delete().
 >
 > An alternative would be for the helper to return an array of formatted
 values, keyed by field. Then the formats stuff is abstracted, and each
 function just do a foreach with `$field => $value`. It might be ugly when
 put together, but it's an idea.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/19019#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list