Server IP : 192.158.238.246 / Your IP : 3.133.87.185 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/jenniferflocom/www/wp-content/plugins/4ecps-webforms/gutenberg-blocks/forms/ |
Upload File : |
const { __ } = wp.i18n; // Import __() from wp.i18n const { registerBlockType } = wp.blocks; registerBlockType( 'ecps/form', { title: __( '4ECPS - Web Form' ), icon: 'forms', category: 'ecps-blocks', keywords: [ __( 'Web Forms' ), __( 'Form' ) ], attributes: { form_id: { type: 'number' } }, edit: function( props ) { const selectStyle = {fontSize: '14px', paddingRight: '5px'}; const { attributes: { form_id }, setAttributes } = props; function setFormId( event ) { const selected = event.target.querySelector( 'option:checked' ); props.setAttributes( { form_id: Number(selected.value) } ); event.preventDefault(); } return ( <div className={ props.className }> <label style={ selectStyle } >4ECPS Form</label> <select value={ form_id } onChange={ setFormId }> {activedemand_forms.map(option => ( <option value={option.value}>{option.label}</option> ))} </select> </div> ); }, save: function() { return null; } } );