public function restrict_page_types() {
		$post_types = papi_get_post_types();

		if ( in_array( $this->post_type, $post_types, true ) ) {
			$page_types = papi_get_all_page_types( $this->post_type );
			$page_types = array_map( function ( $page_type ) {
				return [
					'name'  => $page_type->name,
					'value' => $page_type->get_id()
				];
			}, $page_types );

			// Add the standard page that isn't a real page type.
			if ( papi_filter_settings_show_standard_page_type_in_filter( $this->post_type ) ) {
				$page_types[] = [
					'name'  => papi_filter_settings_standard_page_type_name( $this->post_type ),
					'value' => 'papi-standard-page'
				];
			}

			usort( $page_types, function ( $a, $b ) {
				return strcmp(
					strtolower( $a['name'] ),
					strtolower( $b['name'] )
				);
			} );
			?>
			<select name="page_type" class="postform">
				<option value="0" selected><?php esc_html_e( 'All types', 'papi' ); ?></option>
				<?php
				foreach ( $page_types as $page_type ) {
					printf(
						'<option value="%s" %s>%s</option>',
						esc_attr( $page_type['value'] ),
						papi_get_qs( 'page_type' ) === $page_type['value'] ? ' selected' : '',
						esc_html( $page_type['name'] )
					);
				}
				?>
			</select>
			<?php
		}
	}
public function restrict_page_types() {
		$post_types = papi_get_post_types();

		if ( in_array( $this->post_type, $post_types, true ) ) {
			$page_types = papi_get_all_page_types( $this->post_type );
			$page_types = array_map( function ( $page_type ) {
				return [
					'name'  => $page_type->name,
					'value' => $page_type->get_id()
				];
			}, $page_types );

			// Add the standard page that isn't a real page type.
			if ( papi_filter_settings_show_standard_page_type_in_filter( $this->post_type ) ) {
				$page_types[] = [
					'name'  => papi_filter_settings_standard_page_type_name( $this->post_type ),
					'value' => 'papi-standard-page'
				];
			}

			usort( $page_types, function ( $a, $b ) {
				return strcmp(
					strtolower( $a['name'] ),
					strtolower( $b['name'] )
				);
			} );
			?>
			<select name="page_type" class="postform">
				<option value="0" selected><?php esc_html_e( 'All types', 'papi' ); ?></option>
				<?php
				foreach ( $page_types as $page_type ) {
					printf(
						'<option value="%s" %s>%s</option>',
						esc_attr( $page_type['value'] ),
						papi_get_qs( 'page_type' ) === $page_type['value'] ? ' selected' : '',
						esc_html( $page_type['name'] )
					);
				}
				?>
			</select>
			<?php
		}
	}
public function restrict_page_types ( ) { $ post_types = papi_get_post_types ( ) ; if ( in_array ( $ this -> post_type , $ post_types , true ) ) { $ page_types = papi_get_all_page_types ( $ this -> post_type ) ; $ page_types = array_map ( function ( $ page_type ) { return [ 'name' => $ page_type -> name , 'value' => $ page_type -> get_id ( ) ] ; } , $ page_types ) ; // Add the standard page that isn't a real page type. if ( papi_filter_settings_show_standard_page_type_in_filter ( $ this -> post_type ) ) { $ page_types [ ] = [ 'name' => papi_filter_settings_standard_page_type_name ( $ this -> post_type ) , 'value' => 'papi-standard-page' ] ; } usort ( $ page_types , function ( $ a , $ b ) { return strcmp ( strtolower ( $ a [ 'name' ] ) , strtolower ( $ b [ 'name' ] ) ) ; } ) ; ?>
			<select name="page_type" class="postform">
				<option value="0" selected><?php esc_html_e ( 'All types' , 'papi' ) ; ?></option>
				<?php foreach ( $ page_types as $ page_type ) { printf ( '<option value="%s" %s>%s</option>' , esc_attr ( $ page_type [ 'value' ] ) , papi_get_qs ( 'page_type' ) === $ page_type [ 'value' ] ? ' selected' : '' , esc_html ( $ page_type [ 'name' ] ) ) ; } ?>
			</select>
			<?php } }
Filter page types in post type list.
Filter page types in post type list .