Automattic\WooCommerce\Blocks\BlockTypes
FeaturedItem::restore_global_post
Restore global post data after rendering core/post-title.
Метод класса: FeaturedItem{}
Хуков нет.
Возвращает
Строку.
Использование
$FeaturedItem = new FeaturedItem(); $FeaturedItem->restore_global_post( $block_content, $parsed_block, $block_instance );
- $block_content(строка) (обязательный)
- The block content.
- $parsed_block(массив) (обязательный)
- The full block, including name and attributes.
- $block_instance(WP_Block) (обязательный)
- The block instance.
Код FeaturedItem::restore_global_post() FeaturedItem::restore global post WC 10.5.0
public function restore_global_post( $block_content, $parsed_block, $block_instance ) {
if ( $this->current_item ) {
wp_reset_postdata();
}
return $block_content;
}