[wp-trac] [WordPress Trac] #12498: wp_write_post permissions

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 3 15:02:28 UTC 2010


#12498: wp_write_post permissions
--------------------------+-------------------------------------------------
 Reporter:  ceenz         |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.0
Component:  Post Types    |     Version:  3.0
 Severity:  normal        |    Keywords:     
--------------------------+-------------------------------------------------
 With customs post types shouldn't wp_write_post() check user permissions
 for editing all available post types and not just 'post' or 'page'?

 Eg currently:

 if ( isset( $_POST['post_type'] ) && 'page' == _POST['post_type'] ) {
   if ( !current_user_can( 'edit_pages' ) )
   return new WP_Error( 'edit_pages', __( '' ) );
 } else {
   if ( !current_user_can( 'edit_posts' ) )
   return new WP_Error( 'edit_posts', __( '' ) );
 }

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


More information about the wp-trac mailing list