Skip to content

Commit

Permalink
Add ability to transform [video] shortcodes to video block (#14042)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nahid F. Mohit authored and youknowriad committed Mar 20, 2019
1 parent 946ffcb commit 6b62f8f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/block-library/src/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,42 @@ export const settings = {
return block;
},
},
{
type: 'shortcode',
tag: 'video',
attributes: {
src: {
type: 'string',
shortcode: ( { named: { src } } ) => {
return src;
},
},
poster: {
type: 'string',
shortcode: ( { named: { poster } } ) => {
return poster;
},
},
loop: {
type: 'string',
shortcode: ( { named: { loop } } ) => {
return loop;
},
},
autoplay: {
type: 'string',
shortcode: ( { named: { autoplay } } ) => {
return autoplay;
},
},
preload: {
type: 'string',
shortcode: ( { named: { preload } } ) => {
return preload;
},
},
},
},
],
},

Expand Down

0 comments on commit 6b62f8f

Please sign in to comment.