[wp-trac] [WordPress Trac] #8827: Add 'app_create_post' and 'app_put_post' hooks in Atompub backend.

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 9 10:47:15 GMT 2009


#8827: Add 'app_create_post' and 'app_put_post' hooks in Atompub backend.
-------------------------+--------------------------------------------------
 Reporter:  znarfor      |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.8      
Component:  General      |     Version:  2.7      
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 wp-app.php is not extensible at the moment, by adding this hooks, a plugin
 may be able to do some extra processing once a post is updated or created.

 Use case: an Atom client may use an extension not supported in Wordpress
 core. With this patch, we may be able to support it through a plugin.
 Sample plugin code following.

 {{{
 function app_handle_license($post_ID, $entry)
 {
         foreach ($entry->links as $link) {
                 if ($link['rel'] == 'license') {
                         update_post_meta($post_ID, 'license',
 $link['href']);
                 }
         }
 }

 add_action('app_create_post', 'bm_app_handle_post', 10, /* 2 arguments */
 2);

 add_action('app_put_post', 'bm_app_handle_post', 10, /* 2 arguments */ 2);
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8827>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list