Added getCurrentUser function
Showing
1 changed file
with
10 additions
and
0 deletions
| ... | @@ -85,6 +85,16 @@ function tools_url() { | ... | @@ -85,6 +85,16 @@ function tools_url() { |
| 85 | call_user_func_array(__NAMESPACE__ . '\url', $args); | 85 | call_user_func_array(__NAMESPACE__ . '\url', $args); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | /** | ||
| 89 | * @returns {WP_User} of the currently logged in user | ||
| 90 | */ | ||
| 91 | function getCurrentUser() { | ||
| 92 | global $current_user; | ||
| 93 | get_currentuserinfo(); | ||
| 94 | |||
| 95 | return $current_user; | ||
| 96 | } | ||
| 97 | |||
| 88 | function buffer($callback) { | 98 | function buffer($callback) { |
| 89 | ob_start(); | 99 | ob_start(); |
| 90 | call_user_func($callback); | 100 | call_user_func($callback); | ... | ... |
-
Please register or sign in to post a comment