[wp-trac] [WordPress Trac] #16714: Introduce capabilities for adding new posts

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 9 20:33:35 UTC 2011


#16714: Introduce capabilities for adding new posts
-----------------------------+------------------------------
 Reporter:  nacin            |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Role/Capability  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  dev-feedback     |
-----------------------------+------------------------------
Changes (by Bueltge):

 * cc: frank@… (added)


Comment:

 +10
 current it is many code for add own caps; a example


 {{{
                         foreach ( $snippet_roles as $snippet_role ) {
                                 $wp_roles->add_cap( $snippet_role, 'edit_'
 . $this->post_type_1 );
                                 $wp_roles->add_cap( $snippet_role, 'edit_'
 . $this->post_type_1 . 's' );
                                 $wp_roles->add_cap( $snippet_role,
 'edit_others_' . $this->post_type_1 . 's' );
                                 $wp_roles->add_cap( $snippet_role,
 'publish_' . $this->post_type_1 . 's' );
                                 $wp_roles->add_cap( $snippet_role, 'read_'
 . $this->post_type_1 );
                                 $wp_roles->add_cap( $snippet_role,
 'read_private_' . $this->post_type_1 . 's' );
                                 $wp_roles->add_cap( $snippet_role,
 'delete_' . $this->post_type_1 );
                                 $wp_roles->add_cap( $snippet_role,
 'manage_' . $this->taxonomy_type_1 );
                         }

                         $wp_roles->add_cap( 'author', 'read_' .
 $this->post_type_1 );
                         $wp_roles->add_cap( 'contributor', 'read_' .
 $this->post_type_1 );
                         $wp_roles->add_cap( 'subscriber', 'read_' .
 $this->post_type_1 );

 }}}

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


More information about the wp-trac mailing list