PluginProbe
Restrict User Access – Ultimate Membership & Content Protection / 2.4
Restrict User Access – Ultimate Membership & Content Protection v2.4
trunk 1.3 2.0 2.1.3 2.2.3 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.5 2.6 2.6.1 2.7 2.7.1 2.8 2.8.1
restrict-user-access / models / level.php

level.php in Restrict User Access – Ultimate Membership & Content Protection 2.4, at models/level.php

52 lines 852 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Restrict User Access
4 * @author Joachim Jensen <joachim@dev.institute>
5 * @license GPLv3
6 * @copyright 2022 by Joachim Jensen
7 */
8
9 class RUA_Level implements RUA_Level_Interface
10 {
11 /**
12 * @var WP_Post
13 */
14 private $wp_post;
15
16 /**
17 * @since 2.1
18 * @param WP_Post $post
19 */
20 public function __construct(WP_Post $post = null)
21 {
22 if (is_null($post)) {
23 $post = new WP_Post();
24 }
25 $this->wp_post = $post;
26 }
27
28 /**
29 * @inheritDoc
30 */
31 public function get_id()
32 {
33 return $this->wp_post->ID;
34 }
35
36 /**
37 * @inheritDoc
38 */
39 public function get_title()
40 {
41 return $this->wp_post->post_title;
42 }
43
44 /**
45 * @inheritDoc
46 */
47 public function exists()
48 {
49 return (bool) $this->wp_post->ID;
50 }
51 }
52