Server IP : 192.158.238.246 / Your IP : 52.14.137.94 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/storyboard/ |
Upload File : |
const { __ } = wp.i18n; // Import __() from wp.i18n const { registerBlockType } = wp.blocks; registerBlockType( 'ecps/storyboard', { title: __( '4ECPS - Story board' ), icon: 'excerpt-view', category: 'ecps-blocks', keywords: [ __( 'Storyboards' ), __( 'Storyboard' ) ], attributes: { storyboard_id: { type: 'number' } }, edit: function( props ) { const selectStyle = {fontSize: '14px', paddingRight: '5px'}; const { attributes: { storyboard_id }, setAttributes } = props; function setstoryboardId( event ) { const selected = event.target.querySelector( 'option:checked' ); props.setAttributes( { storyboard_id: Number(selected.value) } ); event.preventDefault(); } return ( <div className={ props.className }> <label style={ selectStyle } >4ECPS Storyboard</label> <select value={ storyboard_id } onChange={ setstoryboardId }> {activedemand_storyboard.map(option => ( <option value={option.value}>{option.label}</option> ))} </select> </div> ); }, save: function() { return null; } } );