public function metabox() {
		$post_type     = papi_get_post_type();
		$page_type     = papi_get_entry_type_by_id( papi_get_page_type_id() );
		$page_type_key = papi_get_page_type_key( 'switch' );
		$page_types    = papi_get_all_page_types( $post_type );
		$show_standard = papi_filter_settings_show_standard_page_type( $post_type );

		if ( $show_standard ) {
			$standard_page_type = papi_get_standard_page_type( $post_type );
			$page_types[]       = $standard_page_type;

			if ( empty( $page_type ) ) {
				$page_type = $standard_page_type;
			}
		}

		usort( $page_types, function ( $a, $b ) {
			return strcmp( $a->name, $b->name );
		} );

		$page_types = papi_sort_order( array_reverse( $page_types ) );

		// Don't do anything without any page types.
		if ( empty( $page_type ) || empty( $page_types ) ) {
			return;
		} ?>

		<div class="misc-pub-section misc-pub-section-last papi-page-type-switcher">
			<label for="<?php echo esc_attr( $page_type_key ); ?>"><?php esc_html_e( 'Page Type:', 'papi' ); ?></label>
			<span><?php echo esc_html( $page_type->name ); ?></span>

			<?php if ( papi_current_user_is_allowed( $page_type->capabilities ) && $page_type->switcher ): ?>
				<a href="#" id="papi-page-type-switcher-edit" class="hide-if-no-js"><?php esc_html_e( 'Edit', 'papi' ); ?></a>
				<div>
					<select name="<?php echo esc_attr( $page_type_key ); ?>" id="<?php echo esc_attr( $page_type_key ); ?>">
						<?php
						foreach ( $page_types as $pt ) {
							if ( ! papi_current_user_is_allowed( $pt->capabilities ) ) {
								continue;
							}

							papi_render_html_tag( 'option', [
								'selected' => $page_type->match_id( $pt->get_id() ),
								'value'    => esc_attr( $pt->get_id() ),

								esc_html( $pt->name )
							] );
						}
						?>
					</select>
					<a href="#" id="papi-page-type-switcher-save" class="hide-if-no-js button"><?php esc_html_e( 'OK', 'papi' ); ?></a>
					<a href="#" id="papi-page-type-switcher-cancel" class="hide-if-no-js"><?php esc_html_e( 'Cancel', 'papi' ); ?></a>
				</div>
			<?php endif; ?>
		</div>
		<?php
	}
public function metabox() {
		$post_type     = papi_get_post_type();
		$page_type     = papi_get_entry_type_by_id( papi_get_page_type_id() );
		$page_type_key = papi_get_page_type_key( 'switch' );
		$page_types    = papi_get_all_page_types( $post_type );
		$show_standard = papi_filter_settings_show_standard_page_type( $post_type );

		if ( $show_standard ) {
			$standard_page_type = papi_get_standard_page_type( $post_type );
			$page_types[]       = $standard_page_type;

			if ( empty( $page_type ) ) {
				$page_type = $standard_page_type;
			}
		}

		usort( $page_types, function ( $a, $b ) {
			return strcmp( $a->name, $b->name );
		} );

		$page_types = papi_sort_order( array_reverse( $page_types ) );

		// Don't do anything without any page types.
		if ( empty( $page_type ) || empty( $page_types ) ) {
			return;
		} ?>

		<div class="misc-pub-section misc-pub-section-last papi-page-type-switcher">
			<label for="<?php echo esc_attr( $page_type_key ); ?>"><?php esc_html_e( 'Page Type:', 'papi' ); ?></label>
			<span><?php echo esc_html( $page_type->name ); ?></span>

			<?php if ( papi_current_user_is_allowed( $page_type->capabilities ) && $page_type->switcher ): ?>
				<a href="#" id="papi-page-type-switcher-edit" class="hide-if-no-js"><?php esc_html_e( 'Edit', 'papi' ); ?></a>
				<div>
					<select name="<?php echo esc_attr( $page_type_key ); ?>" id="<?php echo esc_attr( $page_type_key ); ?>">
						<?php
						foreach ( $page_types as $pt ) {
							if ( ! papi_current_user_is_allowed( $pt->capabilities ) ) {
								continue;
							}

							papi_render_html_tag( 'option', [
								'selected' => $page_type->match_id( $pt->get_id() ),
								'value'    => esc_attr( $pt->get_id() ),

								esc_html( $pt->name )
							] );
						}
						?>
					</select>
					<a href="#" id="papi-page-type-switcher-save" class="hide-if-no-js button"><?php esc_html_e( 'OK', 'papi' ); ?></a>
					<a href="#" id="papi-page-type-switcher-cancel" class="hide-if-no-js"><?php esc_html_e( 'Cancel', 'papi' ); ?></a>
				</div>
			<?php endif; ?>
		</div>
		<?php
	}
public function metabox ( ) { $ post_type = papi_get_post_type ( ) ; $ page_type = papi_get_entry_type_by_id ( papi_get_page_type_id ( ) ) ; $ page_type_key = papi_get_page_type_key ( 'switch' ) ; $ page_types = papi_get_all_page_types ( $ post_type ) ; $ show_standard = papi_filter_settings_show_standard_page_type ( $ post_type ) ; if ( $ show_standard ) { $ standard_page_type = papi_get_standard_page_type ( $ post_type ) ; $ page_types [ ] = $ standard_page_type ; if ( empty ( $ page_type ) ) { $ page_type = $ standard_page_type ; } } usort ( $ page_types , function ( $ a , $ b ) { return strcmp ( $ a -> name , $ b -> name ) ; } ) ; $ page_types = papi_sort_order ( array_reverse ( $ page_types ) ) ; // Don't do anything without any page types. if ( empty ( $ page_type ) || empty ( $ page_types ) ) { return ; } ?>

		<div class="misc-pub-section misc-pub-section-last papi-page-type-switcher">
			<label for="<?php echo esc_attr ( $ page_type_key ) ; ?>"><?php esc_html_e ( 'Page Type:' , 'papi' ) ; ?></label>
			<span><?php echo esc_html ( $ page_type -> name ) ; ?></span>

			<?php if ( papi_current_user_is_allowed ( $ page_type -> capabilities ) && $ page_type -> switcher ) : ?>
				<a href="#" id="papi-page-type-switcher-edit" class="hide-if-no-js"><?php esc_html_e ( 'Edit' , 'papi' ) ; ?></a>
				<div>
					<select name="<?php echo esc_attr ( $ page_type_key ) ; ?>" id="<?php echo esc_attr ( $ page_type_key ) ; ?>">
						<?php foreach ( $ page_types as $ pt ) { if ( ! papi_current_user_is_allowed ( $ pt -> capabilities ) ) { continue ; } papi_render_html_tag ( 'option' , [ 'selected' => $ page_type -> match_id ( $ pt -> get_id ( ) ) , 'value' => esc_attr ( $ pt -> get_id ( ) ) , esc_html ( $ pt -> name ) ] ) ; } ?>
					</select>
					<a href="#" id="papi-page-type-switcher-save" class="hide-if-no-js button"><?php esc_html_e ( 'OK' , 'papi' ) ; ?></a>
					<a href="#" id="papi-page-type-switcher-cancel" class="hide-if-no-js"><?php esc_html_e ( 'Cancel' , 'papi' ) ; ?></a>
				</div>
			<?php endif ; ?>
		</div>
		<?php }
Render metabox.
Render metabox .