wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
block_core_navigation_insert_hooked_blocks_into_rest_response › WordPress Function
Desden/a
Obsoleton/a
› block_core_navigation_insert_hooked_blocks_into_rest_response ( $response, $post )
Parâmetros: (2) |
|
Retorna: |
|
Definido em: |
|
Codex: |
Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks.
Fonte
function block_core_navigation_insert_hooked_blocks_into_rest_response( $response, $post ) { if ( ! isset( $response->data['content']['raw'] ) || ! isset( $response->data['content']['rendered'] ) ) { return $response; } $parsed_blocks = parse_blocks( $response->data['content']['raw'] ); $content = block_core_navigation_insert_hooked_blocks( $parsed_blocks, $post ); // Remove mock Navigation block wrapper. $content = block_core_navigation_remove_serialized_parent_block( $content ); $response->data['content']['raw'] = $content; $response->data['content']['rendered'] = apply_filters( 'the_content', $content ); return $response; }