関数 current_user_can_for_blog()
2014/12/11
関数 current_user_can_for_blog()
定義ファイル :/blog/wp-includes/capabilities.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | function current_user_can_for_blog( $blog_id, $capability ) { if ( is_multisite() ) switch_to_blog( $blog_id ); $current_user = wp_get_current_user(); if ( empty( $current_user ) ) return false; $args = array_slice( func_get_args(), 2 ); $args = array_merge( array( $capability ), $args ); $can = call_user_func_array( array( $current_user, 'has_cap' ), $args ); if ( is_multisite() ) restore_current_blog(); return $can; } |