[wp-trac] [WordPress Trac] #12955: Filter request for get_post

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 16 12:24:31 UTC 2010


#12955: Filter request for get_post
--------------------------+-------------------------------------------------
 Reporter:  JohnLamansky  |       Owner:           
     Type:  enhancement   |      Status:  new      
 Priority:  normal        |   Milestone:  3.0      
Component:  General       |     Version:           
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------

Comment(by JohnLamansky):

 Replying to [comment:2 dd32]:
 > Out of interest, What is the use-case for this exactly?

 I'd like to filter posts retrieved via XMLRPC/APP. Currently, the function
 chain goes like this: ''XMLRPC/APP method -> wp_get_single_post() ->
 get_post()'' -- None of these functions are filtered. Right now I have to
 manually override every single XMLRPC/APP method that retrieves posts,
 which is a pain. I'd love to be able to filter get_post() like this:

 {{{
 if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') )
         add_filter( 'get_post', 'my_plugin_function' );
 }}}

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


More information about the wp-trac mailing list