public function get_post( WP_Post $post ) {
		if ( ! ( $page_type = papi_get_entry_type_by_meta_id( $post->ID ) ) ) {
			return $post;
		}

		// Register all properties fields with register meta.
		foreach ( $page_type->get_properties() as $property ) {
			$property->register();
		}

		// Add filter to prepare the response for a post type.
		add_filter( 'rest_prepare_' . $post->post_type, [$this, 'prepare_response'] );

		return $post;
	}
public function get_post( WP_Post $post ) {
		if ( ! ( $page_type = papi_get_entry_type_by_meta_id( $post->ID ) ) ) {
			return $post;
		}

		// Register all properties fields with register meta.
		foreach ( $page_type->get_properties() as $property ) {
			$property->register();
		}

		// Add filter to prepare the response for a post type.
		add_filter( 'rest_prepare_' . $post->post_type, [$this, 'prepare_response'] );

		return $post;
	}
public function get_post ( WP_Post $ post ) { if ( ! ( $ page_type = papi_get_entry_type_by_meta_id ( $ post -> ID ) ) ) { return $ post ; } // Register all properties fields with register meta. foreach ( $ page_type -> get_properties ( ) as $ property ) { $ property -> register ( ) ; } // Add filter to prepare the response for a post type. add_filter ( 'rest_prepare_' . $ post -> post_type , [ $ this , 'prepare_response' ] ) ; return $ post ; }
Filter the post.

Register all properties with `register_meta` and prepare response filter.

@param  WP_Post $post

@return WP_Post
Filter the post .