| 1 |
<?php |
| 2 |
/** |
| 3 |
* Deprecated restrictions class. |
| 4 |
* |
| 5 |
* @copyright (c) 2023, Code Atlantic LLC. |
| 6 |
* @package ContentControl |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace JP\CC\Site; |
| 10 |
|
| 11 |
use function ContentControl\get_applicable_restriction; |
| 12 |
|
| 13 |
defined( 'ABSPATH' ) || exit; |
| 14 |
|
| 15 |
/** |
| 16 |
* Frontend restriction controller. |
| 17 |
*/ |
| 18 |
class Restrictions { |
| 19 |
|
| 20 |
/** |
| 21 |
* Protected posts. |
| 22 |
* |
| 23 |
* @var array<int> |
| 24 |
*/ |
| 25 |
public static $protected_posts = []; |
| 26 |
|
| 27 |
/** |
| 28 |
* Method to get the protected post content. |
| 29 |
* |
| 30 |
* @return string |
| 31 |
*/ |
| 32 |
public static function restricted_content() { |
| 33 |
$restriction = get_applicable_restriction(); |
| 34 |
return false !== $restriction ? $restriction->get_message() : false; |
| 35 |
} |
| 36 |
} |
| 37 |
|