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