Switch language

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




author_can [ WordPress Function ]

author_can ( $post, $capability )
Parameters:
  • (int|object) $post Post ID or post object.
  • (string) $capability Capability or role name.
Returns:
  • (bool)
Defined at:



Whether author of supplied post has capability or role.

Source


<?php
function author_can$post$capability ) {
    if ( !
$post get_post($post) )
        return 
false;

    
$author = new WP_User$post->post_author );

    if ( empty( 
$author->ID ) )
        return 
false;

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

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

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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