stdClass Object( // [ID] => 7 // [user_login] => adswapper // [user_pass] => $P$BI0CLW9hPzsHqqi1149ZVPuxPXkmby/ // [user_nicename] => adswapper // [user_email] => petern@greatkiwi.co.nz // [user_url] => // [user_registered] => 2014-11-19 02:26:56 // [user_activation_key] => // [user_status] => 0 // [display_name] => Ad Swapper // ) // // [ID] => 7 // // [caps] => Array( // [adswapper] => 1 // ) // // [cap_key] => wp_capabilities // // [roles] => Array( // [0] => adswapper // ) // // [allcaps] => Array( // [read] => 1 // [level_0] => 1 // [adswapper] => 1 // ) // // [filter] => // // ) // // ------------------------------------------------------------------------- //\greatKiwi_byFernTec_adSwapper_local_v0x1x210_testDebug\pr( $current_user_obj ) ; // ------------------------------------------------------------------------- if ( in_array( strtolower( $role_name ) , $current_user_obj->roles , TRUE ) ) { return TRUE ; } // ------------------------------------------------------------------------- return FALSE ; // ========================================================================= // That's that! // ========================================================================= } // ============================================================================= // is_administrator() // ============================================================================= function is_administrator() { // ------------------------------------------------------------------------- // \greatKiwi_byFernTec_adSwapper_local_v0x1x210_wpUserSupport\ // is_administrator() // - - - - - - - - - // RETURNS:- // o TRUE if there's a currently logged-in WordPress user - AND // that user is an Administrator (= has the "manage_options" // capability. // o FALSE otherwise. // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // is_user_logged_in() // - - - - - - - - - - // This Conditional Tag checks if the current visitor is logged in. This is // a boolean function, meaning it returns either TRUE or FALSE. // // This function does not accept any parameters. // // RETURN VALUES // (boolean) // True if user is logged in, false if not logged in. // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // current_user_can( $capability, $args ) // - - - - - - - - - - - - - - - - - - - // Whether the current user has a certain capability. See: Roles and // Capabilities. // // $capability // (string) (required) A capability. This is case-sensitive, and // should be all lowercase. // // Default: None // // $args // (mixed) (optional) Any additional arguments that may be needed, // such as a post ID. Some capability checks (like 'edit_post' or // 'delete_page') require this be provided. // // Default: None // // RETURNS // (boolean) // true if the current user has the capability. // false if the current user does not have the capability. // // Caution: current_user_can returns true even for a non existing or // a junk post id // ------------------------------------------------------------------------- if ( \is_user_logged_in() && \current_user_can( 'manage_options' ) ) { return TRUE ; } // ------------------------------------------------------------------------- return FALSE ; // ------------------------------------------------------------------------- } // ============================================================================= // That's that! // =============================================================================