Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




user_can [ WordPress Function ]

user_can ( $user, $capability )
Parameters:
  • (int|object) $user User ID or object.
  • (string) $capability Capability or role name.
Returns:
  • (bool)
Defined at:



Whether a particular user has capability or role.

Source


<?php
function user_can$user$capability ) {
    if ( ! 
is_object$user ) )
        
$user = new WP_User$user );

    if ( ! 
$user || ! $user->exists() )
        return 
false;

    
$args array_slicefunc_get_args(), );
    
$args array_merge( array( $capability ), $args );

    return 
call_user_func_array( array( &$user'has_cap' ), $args );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics