[wp-trac] [WordPress Trac] #11212: Add filter to wp_parse_args()

WordPress Trac wp-trac at lists.automattic.com
Sat Nov 21 06:35:29 UTC 2009


#11212: Add filter to wp_parse_args()
--------------------------+-------------------------------------------------
 Reporter:  Viper007Bond  |       Owner:           
     Type:  enhancement   |      Status:  new      
 Priority:  lowest        |   Milestone:  2.9      
Component:  General       |     Version:  2.9      
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------

Comment(by Viper007Bond):

 DD32 suggested I stop being lazy and instead just pass the context to
 `wp_list_args()` and then call a `wp_list_args_CONTEXT` filter.

 {{{
 $args = wp_parse_args( $args, $defaults , __FUNCTION__ );
 }}}

 {{{
 return ( !empty($context) ) ? apply_filters( 'wp_parse_args_' .
 strtolower($context), $r, $args, $defaults ) : $r;
 }}}

 Works a lot better and is easier for plugin developers to use.

 Assuming there's interest in this and it's green lit, I'll start regex'ing
 WordPress files to add in the `__FUNCTION__` call or maybe some weird
 hybrid.

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


More information about the wp-trac mailing list