[wp-hackers] current_user_can bug?

Dion Hulse (dd32) wordpress at dd32.id.au
Mon Jun 21 11:17:20 UTC 2010


What about this? I realise it may seem basic, i'm just trying to figure  
out where the cause could be in this case.

global $current_user;
var_dump($current_user->allcaps, $current_user->roles);


On Mon, 21 Jun 2010 21:02:06 +1000, Ash Goodman <ash at thinkinginvain.com>  
wrote:

> Hi Dion, Thanks
>
> I have created a role called 'singleseat' with capability 'canread'
>
> I added the check you told me and it shows the capability being added
> ( string(7) "canread" ). Also when I check the wp_options table the
> role with capability is added.
>
> But when I add a capability check:  current_user_can('canread') in the
> loop it does not work. If I add a role check:
> current_user_can('singleseat') it does.
>
> I am using the Kubrick default theme on 2.9.2 (client doesn't want to
> move to 3.0 yet)
>
> Ash
>
> On 21 June 2010 18:05,  <wp-hackers-request at lists.automattic.com> wrote:
>> Both should work, I'd be triple checking that the capability is actually
>> being applied to the role.
>>
>> Throw this in there beforehand:
>>
>> $role = get_role('custom_role');
>> var_dump($role->capabilities);
>>
>> -- Dion Hulse / dd32
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


-- Dion Hulse / dd32
Contact:
  e: contact at dd32.id.au
  Web: http://dd32.id.au/


More information about the wp-hackers mailing list