Server IP : 172.67.158.161 / Your IP : 18.119.121.88 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/blocks/product-search/ |
Upload File : |
/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { registerBlockType } from '@wordpress/blocks'; import { Icon, search } from '@woocommerce/icons'; /** * Internal dependencies */ import './style.scss'; import './editor.scss'; import Block from './block.js'; import edit from './edit.js'; registerBlockType( 'woocommerce/product-search', { title: __( 'Product Search', 'woocommerce' ), icon: { src: <Icon srcElement={ search } />, foreground: '#96588a', }, category: 'woocommerce', keywords: [ __( 'WooCommerce', 'woocommerce' ) ], description: __( 'A search box to allow customers to search for products by keyword.', 'woocommerce' ), supports: { align: [ 'wide', 'full' ], }, example: { attributes: { hasLabel: true, }, }, attributes: { /** * Whether to show the field label. */ hasLabel: { type: 'boolean', default: true, }, /** * Search field label. */ label: { type: 'string', default: __( 'Search', 'woocommerce' ), source: 'text', selector: 'label', }, /** * Search field placeholder. */ placeholder: { type: 'string', default: __( 'Search products…', 'woocommerce' ), source: 'attribute', selector: 'input.wc-block-product-search__field', attribute: 'placeholder', }, /** * Store the instance ID. */ formId: { type: 'string', default: '', }, }, edit, /** * Save the props to post content. * * @param {Object} attributes Props to pass to block. */ save( attributes ) { return ( <div> <Block { ...attributes } /> </div> ); }, } );