class.jetpack.php 1 location
|
@@ 4391-4399 (lines=9) @@
|
| 4388 |
|
return $url; |
| 4389 |
|
} |
| 4390 |
|
|
| 4391 |
|
static function translate_current_user_to_role() { |
| 4392 |
|
foreach ( self::$capability_translations as $role => $cap ) { |
| 4393 |
|
if ( current_user_can( $role ) || current_user_can( $cap ) ) { |
| 4394 |
|
return $role; |
| 4395 |
|
} |
| 4396 |
|
} |
| 4397 |
|
|
| 4398 |
|
return false; |
| 4399 |
|
} |
| 4400 |
|
|
| 4401 |
|
static function translate_user_to_role( $user ) { |
| 4402 |
|
foreach ( self::$capability_translations as $role => $cap ) { |
packages/roles/src/Roles.php 1 location
|
@@ 37-45 (lines=9) @@
|
| 34 |
|
* |
| 35 |
|
* @return string|boolean Current user's role, false if not enough capabilities for any of the roles. |
| 36 |
|
*/ |
| 37 |
|
public static function translate_current_user_to_role() { |
| 38 |
|
foreach ( self::$capability_translations as $role => $cap ) { |
| 39 |
|
if ( current_user_can( $role ) || current_user_can( $cap ) ) { |
| 40 |
|
return $role; |
| 41 |
|
} |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
return false; |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
/** |
| 48 |
|
* Get the role of a particular user. |