Automattic\WooCommerce\Blocks\BlockTypes
ProductFiltersOverlay::enqueue_data()
Extra data passed through from server to client for block.
Method of the class: ProductFiltersOverlay{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->enqueue_data( $attributes );
- $attributes(array)
- Any attributes that currently are available from the block. Note, this will be empty in the editor context when the block is not in the post content on editor load.
Default: []
ProductFiltersOverlay::enqueue_data() ProductFiltersOverlay::enqueue data code WC 9.4.2
protected function enqueue_data( array $attributes = [] ) { parent::enqueue_data( $attributes ); $template_part_edit_uri = ''; if ( current_user_can( 'edit_theme_options' ) && ( wc_current_theme_is_fse_theme() || current_theme_supports( 'block-template-parts' ) ) ) { $theme_slug = BlockTemplateUtils::theme_has_template_part( 'product-filters-overlay' ) ? wp_get_theme()->get_stylesheet() : BlockTemplateUtils::PLUGIN_SLUG; $site_editor_uri = add_query_arg( array( 'canvas' => 'edit', 'path' => '/template-parts/single', ), admin_url( 'site-editor.php' ) ); $template_part_edit_uri = esc_url_raw( add_query_arg( array( 'postId' => sprintf( '%s//%s', $theme_slug, 'product-filters-overlay' ), 'postType' => 'wp_template_part', ), $site_editor_uri ) ); } $this->asset_data_registry->add( 'templatePartProductFiltersOverlayEditUri', $template_part_edit_uri ); }