Changeset 47360 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php
- Timestamp:
- 02/25/2020 03:03:57 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php
r47122 r47360 136 136 } 137 137 $registry = WP_Block_Type_Registry::get_instance(); 138 $block = $registry->get_registered( $request['name'] );139 138 140 if ( null === $ block) {139 if ( null === $registry->get_registered( $request['name'] ) ) { 141 140 return new WP_Error( 142 141 'block_invalid', … … 148 147 } 149 148 149 $attributes = $request->get_param( 'attributes' ); 150 151 // Create an array representation simulating the output of parse_blocks. 152 $block = array( 153 'blockName' => $request['name'], 154 'attrs' => $attributes, 155 'innerHTML' => '', 156 'innerContent' => array(), 157 ); 158 159 // Render using render_block to ensure all relevant filters are used. 150 160 $data = array( 151 'rendered' => $block->render( $request->get_param( 'attributes' )),161 'rendered' => render_block( $block ), 152 162 ); 153 163
Note: See TracChangeset
for help on using the changeset viewer.