[wp-trac] Re: [WordPress Trac] #4516: A bit more filtering needed on admin screens

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 25 19:45:42 GMT 2007


#4516: A bit more filtering needed on admin screens
------------------------------------+---------------------------------------
 Reporter:  jhodgdon                |        Owner:  anonymous  
     Type:  defect                  |       Status:  new        
 Priority:  normal                  |    Milestone:  2.3 (trunk)
Component:  Administration          |      Version:  2.3        
 Severity:  normal                  |   Resolution:             
 Keywords:  admin filter has-patch  |  
------------------------------------+---------------------------------------
Comment (by ryan):

 I think some better API would help eliminate having to apply filters by
 hand everywhere.

 First, let's move the bloginfo filter into get_bloginfo.

 Add a 'the' context to sanitize_term() and sanitize_term_field().  'the'
 will trigger the_term_$field and the_$taxonomy_$field filters in addition
 to the existing term_$field and $taxonomy_$field filters.  We'll need to
 map the_$taxonomy_name to the_$taxonomy for back compat.

 Add a filter argument to get_term().  If filter is specified, get_term()
 will use it to sanitize_term.  The cache should store only unfiltered
 terms, so filtering should be done after the cache add.

 Add a filter option to get_terms().  If a filter is specified, get_terms()
 will run sanitize_term() against each fetched term object.

 Do the same for posts and other objects.  Create sanitize_post() and
 sanitize_post_field() and add a filter argument to get_post().

 In those places where we have to filter a field by hand, use
 sanitize_term_field(), sanitize_post_field(), etc. to trigger the filters
 instead of calling apply_filters directly.

 Thoughts?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4516#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list