HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux bsx-1-dev 6.8.0-101-generic #101-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 9 10:15:05 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/memberpress/app/controllers/MeprPostStatesCtrl.php
<?php

if (!defined('ABSPATH')) {
    die('You are not allowed to call this page directly.');
}

class MeprPostStatesCtrl extends MeprBaseCtrl
{
    /**
     * Loads the hooks.
     *
     * @return void
     */
    public function load_hooks()
    {
        add_filter('display_post_states', [$this, 'add_display_post_states'], 10, 2);
    }

    /**
     * Adds the display post states.
     *
     * @param  array   $post_states The post states.
     * @param  WP_Post $post        The post.
     * @return array
     */
    public function add_display_post_states($post_states, $post)
    {

        $mepr_options = MeprOptions::fetch();

        if ($mepr_options->thankyou_page_id === $post->ID) {
            $post_states['thankyou_page_id'] = __('MemberPress Thank You Page', 'memberpress');
        }

        if ($mepr_options->account_page_id === $post->ID) {
            $post_states['account_page_id'] = __('MemberPress Account Page', 'memberpress');
        }

        if ($mepr_options->login_page_id === $post->ID) {
            $post_states['login_page_id'] = __('MemberPress Login Page', 'memberpress');
        }

        return $post_states;
    }
}