| 1 |
<?php |
| 2 |
/** |
| 3 |
* Deprecated Is class. |
| 4 |
* |
| 5 |
* @copyright (c) 2023, Code Atlantic LLC. |
| 6 |
* @package ContentControl |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace JP\CC; |
| 10 |
|
| 11 |
defined( 'ABSPATH' ) || exit; |
| 12 |
|
| 13 |
/** |
| 14 |
* Conditional helper utilities. |
| 15 |
* |
| 16 |
* @package ContentControl |
| 17 |
* |
| 18 |
* @deprecated 2.0.0 |
| 19 |
*/ |
| 20 |
class Is { |
| 21 |
|
| 22 |
/** |
| 23 |
* Check if a content is accessible to current user. |
| 24 |
* |
| 25 |
* @param string $who logged_in or logged_out. |
| 26 |
* @param string[]|array<string,string>|string $roles array of roles to check. |
| 27 |
* |
| 28 |
* @return bool |
| 29 |
* |
| 30 |
* @deprecated 2.0.0 |
| 31 |
*/ |
| 32 |
public static function accessible( $who = '', $roles = [] ) { |
| 33 |
return \ContentControl\user_meets_requirements( $who, $roles, 'match' ); |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Check if a content is blocked to current user. |
| 38 |
* |
| 39 |
* @param string $who logged_in or logged_out. |
| 40 |
* @param string[]|array<string,string>|string $roles array of roles to check. |
| 41 |
* |
| 42 |
* @return boolean |
| 43 |
* |
| 44 |
* @deprecated 2.0.0 |
| 45 |
*/ |
| 46 |
public static function restricted( $who = '', $roles = [] ) { |
| 47 |
return ! \ContentControl\user_meets_requirements( $who, $roles, 'match' ); |
| 48 |
} |
| 49 |
} |
| 50 |
|