Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Example code of using inner blocks in Wordpress with ES5

( function ( blocks, element, blockEditor ) {
    var el = element.createElement;
    var InnerBlocks = blockEditor.InnerBlocks;
    var useBlockProps = blockEditor.useBlockProps;
 
    blocks.registerBlockType( 'softhunt/inner-example', {
        title: 'Inner Blocks',
        category: 'design',
 
        edit: function () {
            var blockProps = useBlockProps();
 
            return el( 'div', blockProps, el( InnerBlocks ) );
        },
 
        save: function () {
            var blockProps = useBlockProps.save();
 
            return el( 'div', blockProps, el( InnerBlocks.Content ) );
        },
    } );
} )( window.wp.blocks, window.wp.element, window.wp.blockEditor );
Comment

PREVIOUS NEXT
Code Example
Javascript :: Promisify with ajax call 
Javascript :: const and let keywords in ES6 
Javascript :: Implicit returns in ES6 
Javascript :: show route between markers google maps javascript 
Javascript :: golang json time 
Javascript :: hide header in next js page 
Javascript :: ajax:drop-down remove an d add select option 
Javascript :: populating selectfield from json file 
Javascript :: documetn 
Javascript :: Write File to the Operating System with NodeJS 
Javascript :: loader on map function in react js 
Javascript :: How to load query params on first render next js 
Javascript :: root emit with params 
Javascript :: How do you convert VARCHAR to TIMESTAMP 
Javascript :: space station json file 
Javascript :: netlify not deploying react site 
Javascript :: enquire js - simple media query library for Javascript 
Javascript :: trackpad scrolling detected multiple times 
Javascript :: react Fractional rating 
Javascript :: Refresh Mathjax formater 
Javascript :: how to make a popeyes chicken sandwich 
Javascript :: jquery iframe navigate handler 
Javascript :: cantsee auto complete for node jsmodules in vs code 
Javascript :: caeser psypher javascript 
Javascript :: how to create custom callback function in javascript 
Javascript :: Syntax highlighting for the Web 
Javascript :: jshint defined variable which are coming from different file 
Javascript :: how to take out text from array of strings in react 
Javascript :: Subscription field must return Async Iterable. Received: undefined. 
Javascript :: expressjs cors blocked mixed-content 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =