[wp-trac] Re: [WordPress Trac] #9209: Ajax for public pages (à la admin-ajax.php)

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 22 04:08:48 GMT 2009


#9209: Ajax for public pages (à la admin-ajax.php)
-------------------------+--------------------------------------------------
 Reporter:  DanCoulter   |       Owner:  anonymous              
     Type:  enhancement  |      Status:  new                    
 Priority:  normal       |   Milestone:  2.8                    
Component:  General      |     Version:  2.7                    
 Severity:  normal       |    Keywords:  has-patch needs-testing
-------------------------+--------------------------------------------------

Comment(by filosofo):

 Replying to [ticket:9209 DanCoulter]:
 > There's no way for plugins or themes to call custom Ajax actions on
 public parts of the blog without calling files in the plugin or theme
 directory directly.

 Actually, all you have to do is send your xhr request to something like
 {{{http://example.com/?my-special-request=1}}}

 Then hook into the init action:

 {{{
 add_action('init', 'check_for_xhr');
 function check_for_xhr() {
      if ( ! empty( $_GET['my-special-request'] ) )
           // do whatever

 }
 }}}

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


More information about the wp-trac mailing list