Désolé, aucune actualité trouvée. Veuillez essayer un autre filtre.
( function ( blocks, element, components, blockEditor ) { const el = element.createElement; const TextControl = components.TextControl; const PanelBody = components.PanelBody; const InspectorControls = blockEditor.InspectorControls; blocks.registerBlockType('germain/wpa-verified-badge', { title: 'Badge annonce vérifiée', icon: 'yes-alt', category: 'widgets', attributes: { text: { type: 'string', default: 'Annonce Vérifiée et sécurisée par MicroPaiement' }, min_total: { type: 'number', default: 0 }, }, edit: function (props) { const a = props.attributes; return el( element.Fragment, null, el( InspectorControls, null, el( PanelBody, { title: 'Paramètres du badge', initialOpen: true }, el(TextControl, { label: 'Texte affiché', value: a.text, onChange: (v) => props.setAttributes({ text: v }), }), el(TextControl, { label: 'Seuil minimum (total paiement >)', help: '0 = micropaiement OK (1€, 2€, etc.)', value: String(a.min_total), onChange: (v) => props.setAttributes({ min_total: parseFloat(v || '0') }), }) ) ), el( 'div', { style: { padding: '10px', border: '1px dashed #27ae60', borderRadius: '10px' } }, el('strong', null, '✓ ' + (a.text || 'Annonce Vérifiée et sécurisée par MicroPaiement')) ) ); }, save: function () { return null; // rendu PHP }, }); } )( window.wp.blocks, window.wp.element, window.wp.components, window.wp.blockEditor );