[wp-hackers] "role_has_cap" Filter

Otto otto at ottodestruct.com
Tue Apr 8 17:31:10 GMT 2008

On Tue, Apr 8, 2008 at 7:02 AM, Viper007Bond <viper at viper007bond.com> wrote:
> I'm trying to make  current_user_can( 'edit_dashboard' )  return TRUE for
>  all users without getting ugly and actually modifying roles.
>  "role_has_cap" seems to be the filter to do this, but I can't seem to get my
>  function that's been added to that hook to fire.
>  Any insight?

Something like this, perhaps...

function give_dash_edit($allcaps, $caps, $args) {
	$allcaps['edit_dashboard'] = true;
	return $allcaps;
add_filter('user_has_cap', 'give_dash_edit', 10, 3);

More information about the wp-hackers mailing list