public function setup_fields() {
		if ( ! function_exists( 'register_rest_field' ) ) {
			return;
		}

		$post_types = papi_get_post_types();

		foreach ( $post_types as $post_type ) {
			register_rest_field( $post_type, 'page_type', [
				'get_callback' => [$this, 'get_page_type']
			] );
		}
	}
public function setup_fields() {
		if ( ! function_exists( 'register_rest_field' ) ) {
			return;
		}

		$post_types = papi_get_post_types();

		foreach ( $post_types as $post_type ) {
			register_rest_field( $post_type, 'page_type', [
				'get_callback' => [$this, 'get_page_type']
			] );
		}
	}
public function setup_fields ( ) { if ( ! function_exists ( 'register_rest_field' ) ) { return ; } $ post_types = papi_get_post_types ( ) ; foreach ( $ post_types as $ post_type ) { register_rest_field ( $ post_type , 'page_type' , [ 'get_callback' => [ $ this , 'get_page_type' ] ] ) ; } }
Setup REST API fields.
Setup REST API fields .