HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/gopalak/public_html/wp-content/plugins/restrict-user-access/models/level.php
<?php
/**
 * @package Restrict User Access
 * @author Joachim Jensen <joachim@dev.institute>
 * @license GPLv3
 * @copyright 2024 by Joachim Jensen
 */

class RUA_Level implements RUA_Level_Interface
{
    /**
     * @var WP_Post
     */
    private $wp_post;

    /**
     * @since 2.1
     * @param WP_Post|null $post
     */
    public function __construct(?WP_Post $post = null)
    {
        if (is_null($post)) {
            $post = new WP_Post((object)[]);
        }
        $this->wp_post = $post;
    }

    /**
     * @inheritDoc
     */
    public function get_id()
    {
        return $this->wp_post->ID;
    }

    /**
     * @inheritDoc
     */
    public function get_title()
    {
        return $this->wp_post->post_title;
    }

    /**
     * @inheritDoc
     */
    public function exists()
    {
        return (bool) $this->wp_post->ID;
    }
}