ype' => 'select', 'attribute_orderby' => 'menu_order', 'attribute_public' => 0, ); if ( $attribute_id ) { $default_attribute = $attributes[ $attribute_id ]; set_transient( 'wc_block_product_filter_attribute_default_attribute', $default_attribute, DAY_IN_SECONDS ); } return $default_attribute; } /** * Register pattern for default product attribute. */ public function register_block_patterns() { $default_attribute = $this->get_default_product_attribute(); register_block_pattern( 'woocommerce/default-attribute-filter', array( 'title' => '', 'inserter' => false, 'content' => strtr( '

{{attribute_label}}

', array( '{{attribute_id}}' => intval( $default_attribute->attribute_id ), '{{attribute_label}}' => esc_html( $default_attribute->attribute_label ), ) ), ) ); } /** * Disable the editor style handle for this block type. * * @return null */ protected function get_block_type_editor_style() { return null; } /** * Disable the script handle for this block type. We use block.json to load the script. * * @param string|null $key The key of the script to get. * @return null */ protected function get_block_type_script( $key = null ) { return null; } }