[wp-trac] [WordPress Trac] #26673: Enhance wp_parse_args() by adding filters before/after the array_merge()

WordPress Trac noreply at wordpress.org
Wed Dec 18 18:16:30 UTC 2013


#26673: Enhance wp_parse_args() by adding filters before/after the array_merge()
-----------------------------------+------------------
 Reporter:  johnjamesjacoby        |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  3.9
Component:  Plugins                |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------

Comment (by johnjamesjacoby):

 Replying to [comment:4 nacin]:
 > I'm not sure we'd want to allow such brute-forcing.
 We already do in places where filters are applied immediately after
 `wp_parse_args()` calls.

 > The approach we have discussed previously is to add filters directly to
 argument arrays wherever they are desired. wp_parse_args() should be
 considered a low-level utility that should ideally stay filter-free. See
 #11212 for a lot more.
 Great discussion there, and neat how we both came to the same conclusion
 having run into the same issues. Understanding that it's a low-level
 utility, even 'request' has a filter on it for brute-forcing.

 For what it's worth, bbPress already heavily utilizes this, and BuddyPress
 will start with 2.0. It's a great (albeit powerful) way to increase the
 flexibility of the codebase, and offload some decision making from the
 development process onto an existing API.

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


More information about the wp-trac mailing list