[wp-trac] [WordPress Trac] #15018: Filtering _wp_meta_sql for advanced queries

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 3 05:48:42 UTC 2010


#15018: Filtering _wp_meta_sql for advanced queries
-------------------------+--------------------------------------------------
 Reporter:  sc0ttkclark  |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Plugins      |     Version:  3.1            
 Severity:  normal       |    Keywords:  metadata       
-------------------------+--------------------------------------------------
 Currently in the code for 3.1 (trunk) there are no filters running on the
 new function _wp_meta_sql which would be useful for plugins to perform
 more complex MySQL functionality on specific columns.

 I suggest adding a filter ;)

 To the tune of my last ticket - it checks if the value returned is null,
 if it's not null then it will return the value, otherwise it will continue
 on like normal.

 DOWNSIDE: The downside to the filter running as-is right now is that this
 function is used by both get_users and get_posts (down the code pipeline)
 and get_posts >> WP_Query::query has a 'suppress_filters' option which
 when set to true skips over these types of filters. This being inside of
 _wp_meta_sql with no way to get at that 'suppress_filters' flag. Does it
 make sense to account for $q and $qv or alternatively &$this in the
 _wp_meta_sql function for checking that flag?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15018>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list