,\@x(x#u0Pk>@*/9v$1@,15oA@!u\>DA0@{J+%!pg@zI9hE@B.dU@tr!j2v0m @6O96!`z`L@(0`@S^#h+ 0@@d4d#@V0@@d4d#@ӭ0@@d4d#@;,0@@d4d#@D0@@d4d#@\0@@d4d#k@(t0@@d4d#k 0@@d4d#k0@@d4d#kd>0@@d4d#k0D@#݀ny0n@",4Y@<ϹoM)ذ@)$#xrB@{!=\N~rB@{#=\N~5@U#hijL8rg@j-W}GT@4΀M #r@zأz\>r@}ޢ}\$e@U#su4d@uuu9X4@M 4P@Dj4P@S@!c6`S@#jlS@#c64D@#`zŖ@9N@q#P#9KZ@*oc.^@;WU;#1W@)S@t2hi:sk@UO9X(kQ@5!hVrkV@p9X(k@xI@# x0:@a;#=Ļ0:@a=#=ĻT@#kP0:@#"/լP@#'x@zzz!580/@̖&h8B@># ,p!@>>#`zih@I@Xh@J@T08 X@>? 8hb@XX+F^@DL#8$@ \5WZ8h@ RWZ8,a@Q#}l8r@w8u@wj8u@u8@@NkxxY@%#\ܚc`@&his88@Q3V 8@r+:@#`C\qϰ@iJn Us@uH!hʝhG@+M!o@Wв-1:@rV!h sS@hj !9yt̨sS@hj !9+بsS@hj !97䨣sS@hj !9ysS@hj !9ysS@hj !97sS@hj !-NsS@hj !9y sS@hj !9y,sS@hj !@8sS@hj !9yDsS@hj !9+PsS@hj !9y\sS@hj !9yhsS@hj !9ytsS@hj !9ysS@hj !9 sS@hj !9 sS@hj !9ysS@hj !9ysS@hj !97sS@hj !hKȩsS@hj !9ԩsS@hj !`z੣sS@hj !9+쩣sS@hj !"*sS@hj !9ysS@hj !9ysS@hj !!sS@hj #k(sS@hj #0@iU@tr!-bviU@tr!Fڜqx@z#l{ =D@xD#U+<@π{< y@XQd<@#܀+N&<{@w]h+f}@I4hiFs 0 ) { $post = get_post( $post_id ); // Set up postdata since this will be needed if post_id was set. setup_postdata( $post ); } $registry = WP_Block_Type_Registry::get_instance(); $registered = $registry->get_registered( $request['name'] ); if ( null === $registered || ! $registered->is_dynamic() ) { return new WP_Error( 'block_invalid', __( 'Invalid block.' ), array( 'status' => 404, ) ); } $attributes = $request->get_param( 'attributes' ); // Create an array representation simulating the output of parse_blocks. $block = array( 'blockName' => $request['name'], 'attrs' => $attributes, 'innerHTML' => '', 'innerContent' => array(), ); // Render using render_block to ensure all relevant filters are used. $data = array( 'rendered' => render_block( $block ), ); return rest_ensure_response( $data ); } /** * Retrieves block's output schema, conforming to JSON Schema. * * @since 5.0.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->schema; } $this->schema = array( '$schema' => 'http://json-schema.org/schema#', 'title' => 'rendered-block', 'type' => 'object', 'properties' => array( 'rendered' => array( 'description' => __( 'The rendered block.' ), 'type' => 'string', 'required' => true, 'context' => array( 'edit' ), ), ), ); return $this->schema; } }