current_user_can [ WordPress Function ]
current_user_can ( $capability )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: current_user_can_for_blog, set_current_user, get_current_user_id, clean_user_cache, get_currentuserinfo
Whether current user has capability or role.
Source
<?php
function current_user_can( $capability ) {
$current_user = wp_get_current_user();
if ( empty( $current_user ) )
return false;
$args = array_slice( func_get_args(), 1 );
$args = array_merge( array( $capability ), $args );
return call_user_func_array( array( $current_user, 'has_cap' ), $args );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- current_user_can() - WordPress Codex
Description. Whether the current user has a certain capability or role. See: Roles and Capabilities. It will only return true if a logged in user's role or capability ...
codex.wordpress.org - WordPress › Support » Tags — current_user_can
(forgot?) Register · WordPress › Support » current_user_can ...
wordpress.org - what are current_user_can () function parameters? - Stack Overflow
what are current_user_can () function parameters ? this function is ... This should be a complete list: Roles and Capabilities - Capabilities ...
stackoverflow.com - How To Show Content For Specific Users In WordPress Templates ...
May 2, 2008 ... <?php elseif (current_user_can('level_0')) : ?> <?php print "read and comment only"; ?> <?php else : ?> <?php print "you gotta log-in to see the ...
www.bravenewcode.com
Gebruikersdiscussies [ wordpress.org ]
- j3ddesign on "Current_User_Can, multiple args question"
- Sarah Anderson on "Protecting user profile edits"
- anmari on "current_user_can broken using multisite"
- audiofreak9 on "current_user_can not working with custom roles"
- havahula on "current_user_can not working with custom roles"
- dgilfoy on "current_user_can not working with custom roles"
- spstieng on "current_user_can not working with custom roles"
- Geert on "current_user_can not working with custom roles"
- havahula on "current_user_can not working with custom roles"
- DougJoseph on "current_user_can not working with custom roles"