| 1 |
<?php |
| 2 |
|
| 3 |
use AgeGate\Common\Content; |
| 4 |
|
| 5 |
if (!function_exists('age_gate_is_restricted')) { |
| 6 |
function age_gate_is_restricted($id = null, $type = 'post') |
| 7 |
{ |
| 8 |
return (new Content($id, $type))->isRestricted(); |
| 9 |
} |
| 10 |
} |
| 11 |
|
| 12 |
if (!function_exists('age_gate_has_restriction')) { |
| 13 |
function age_gate_has_restriction($id = null, $type = 'post') |
| 14 |
{ |
| 15 |
|
| 16 |
return (new Content($id, $type))->getRestricted(); |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
if (!function_exists('age_gate_content')) { |
| 21 |
function age_gate_content($id = null, $type = 'post') |
| 22 |
{ |
| 23 |
|
| 24 |
return new Content($id, $type); |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
if (!function_exists('age_gate_error')) { |
| 29 |
/** |
| 30 |
* @deprecated 3.0.0 |
| 31 |
*/ |
| 32 |
function age_gate_error($key) |
| 33 |
{ |
| 34 |
return null; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
if (!function_exists('age_gate_set_value')) { |
| 39 |
/** |
| 40 |
* @deprecated 3.0.0 |
| 41 |
*/ |
| 42 |
function age_gate_set_value($key) |
| 43 |
{ |
| 44 |
return null; |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
if (!function_exists('age_gate_status')) { |
| 49 |
/** |
| 50 |
* @deprecated 3.0.0 |
| 51 |
*/ |
| 52 |
function age_gate_status() |
| 53 |
{ |
| 54 |
return null; |
| 55 |
} |
| 56 |
} |
| 57 |
|