[wp-trac] [WordPress Trac] #16714: Introduce capabilities for adding new posts
WordPress Trac
wp-trac at lists.automattic.com
Mon Apr 18 14:43:07 UTC 2011
#16714: Introduce capabilities for adding new posts
-----------------------------+-----------------------
Reporter: nacin | Owner: casben79
Type: enhancement | Status: accepted
Priority: normal | Milestone: 3.2
Component: Role/Capability | Version:
Severity: normal | Resolution:
Keywords: has-patch |
-----------------------------+-----------------------
Comment (by kevinB):
Replying to [comment:15 casben79]:
> @kevinb: Interesting thought, this could be useful for plugin / theme
authors as well.
>
> {{{
> //Guilty untill proven innocent?
> $_wp_menu_nopriv[$data[2]] = true;
> if( is_array( $data[1] ) ){
> foreach( $data[1] as $cap ){
> if( current_user_can( $cap ) ){
> unset( $_wp_menu_nopriv[$data[2]] );
> }
> }
> } else {
> if ( current_user_can($data[1]) )
> unset( $_wp_menu_nopriv[$data[2]] );
> }
> }}}
>
> And then:
>
> {{{
> $menu[5] = array( __('Posts'), array( 'edit_posts' , 'create_posts' ) ,
'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts',
'div' );
> }}}
>
> What do you think?
>
>
I think supporting creation-only usage of the full post edit form (with
redirect back to dashboard following creation) would be nice. But that
would take some work in post.php also. At the very least you would need
to redirect back to the dashboard following post creation. But wouldn't
there also be some complications (edit_posts cap checking) due to auto-
creation of new posts?
As it stands in the patch now, a user with create_posts (but not
edit_posts) sees no "Add New" menu link but can still access post-new.php
by direct URL.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16714#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list