[wp-hackers] register_post_type not completing with capability_type set to custom value

Tom Jenkins tom at thejenkinsweb.com
Tue Oct 30 19:34:05 UTC 2012


This is one of those "duh" moments, Thanks John and Tom, that was the issue.

Tom



On Tue, Oct 30, 2012 at 11:55 AM, Tom Barrett <tcbarrett at gmail.com> wrote:

> I have something like this in my dev for adding caps to users as I update
> and change things:
>
> $cpt_caps = array( 'edit_post', 'read_post', 'delete_post', 'edit_posts',
> 'edit_others_posts', 'publish_posts', 'read_private_posts' );
> $admin    = &get_role( 'administrator' );
> $mycpts   = array( 'adc_pfinder' );
> foreach( $mycpts as $cptslug ) :
>   $cpt  = get_post_type_object( $cptslug );
>   foreach( $cpt_caps as $cap ) :
>     $admin->add_cap( $cpt->cap->$cap );
>   endforeach;
> endforeach;
>
> (off the top of my head, may contain syntax errors)
>
> --
> http://www.tcbarrett.com | http://gplus.to/tcbarrett |
> http://twitter.com/tcbarrett
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list