Skip to content

Commit

Permalink
Improve the API handling for block patterns REST API endpoing
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Sep 8, 2023
1 parent ba3cbc2 commit 87a2b29
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public function prepare_item_for_response( $item, $request ) {

$data = $response->get_data();

if ( empty( $data['content'] ) ) {
return $response;
}

$blocks = parse_blocks( $data['content'] );
$data['content'] = gutenberg_serialize_blocks( $blocks ); // Serialize or render?
Expand Down

0 comments on commit 87a2b29

Please sign in to comment.