# ablocks/2.14.0/includes/create-page/page/show-page-state.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.14.0. 43 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.14.0/code/includes/create-page/page/show-page-state.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.14.0/raw/includes/create-page/page/show-page-state.php
- Modified: 2025-03-06T07:54:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ablocks/2.14.0/code/includes/create-page/page/show-page-state.php#L10-L20`.

```php
<?php
namespace ABlocks\CreatePage\Page;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class ShowPageState {
	public static function init() : void {
		$instance = new static();
		add_filter( 'display_post_states', [ $instance, 'show_page_state' ], 10, 2 );
	}
	public function show_page_state( $states, $post ) {
		if ( $post->post_type !== 'page' ) {
			return $states;
		}

		$pages = [];
		if ( property_exists( $GLOBALS['ablocks_settings'] ?? '', 'login_page' ) ) {
			$pages[ $GLOBALS['ablocks_settings']->login_page ] = 'login_page';
		}
		if ( property_exists( $GLOBALS['ablocks_settings'] ?? '', 'registration_page' ) ) {
			$pages[ $GLOBALS['ablocks_settings']->registration_page ] = 'registration_page';
		}
		if ( property_exists( $GLOBALS['ablocks_settings'] ?? '', 'forget_password_page' ) ) {
			$pages[ $GLOBALS['ablocks_settings']->forget_password_page ] = 'forget_password_page';
		}
		$page_type = get_post_meta( $post->ID, 'ablock_page_type', true );
		if (
			! empty( $page_type )
		) {
			$states[] = esc_html( str_replace( '_', ' ', ucfirst( $page_type ) ) . ' page' );
		} elseif (
			array_key_exists( $post->ID, $pages )
		) {
			$states[] = esc_html( str_replace( '_', ' ', ucfirst( $pages[ $post->ID ] ) ) . ' page' );
		}

		return $states;
	}

}

```
