123456789101112131415161718192021222324252627282930313233 |
- registerBlockType('my-plugin/event-location', {
- title: 'Media URL',
- category: 'widgets',
- attributes: {
- location: {
- type: 'string',
- source: 'meta',
- meta: 'media_url'
- }
- },
- edit ({ className, attributes, setAttributes }) {
- const { location } = attributes
- function updateContent (e) {
- setAttributes({ location: e.target.value })
- }
- return el(
- 'p',
- { className: className },
- el(
- 'input',
- { value: location, onChange: updateContent }
- )
- )
- },
- save () {
- return null
- }
- })
|