Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Example code of using inner blocks in Wordpress with ESNext

import { registerBlockType } from '@wordpress/blocks';
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
 
registerBlockType( 'softhunt/inner-example', {
    // ...
 
    edit: () => {
        const blockProps = useBlockProps();
 
        return (
            <div { ...blockProps }>
                <InnerBlocks />
            </div>
        );
    },
 
    save: () => {
        const blockProps = useBlockProps.save();
 
        return (
            <div { ...blockProps }>
                <InnerBlocks.Content />
            </div>
        );
    },
} );
Comment

PREVIOUS NEXT
Code Example
Javascript :: Adding Custom Admin Notices in the Classic Editor wordpress 
Javascript :: Array helper functions in ES6 
Javascript :: Key and property shorthand in ES6 
Javascript :: Enable Cookies and JavaScript in Internet Explorer 9.0 
Javascript :: date filter in angular 8 
Javascript :: where is the waypoint json file lunar client mac 
Javascript :: format file using jq 
Javascript :: js regexp eth wallet 
Javascript :: angular material table generator 
Javascript :: .pop get second element of url 
Javascript :: reset default style javascript 
Javascript :: find duplicate objects in array js 
Javascript :: header fetch as string 
Javascript :: btn click on click file javascript 
Javascript :: Javascripttrepeat 
Javascript :: get seo friendly url values in javascript 
Javascript :: rest framework and json 
Javascript :: Javascript one parameter fat arrow 
Javascript :: react Bootstrap Five Heart rating 
Javascript :: Format Mathjax 
Javascript :: how to angular html ts function 
Javascript :: how insert variable dotenv password mangodb 
Javascript :: how to store and get a single variable in local storage js 
Javascript :: webpack no chunks 
Javascript :: alterar estilo com getElements 
Javascript :: android MediaController audio example 
Javascript :: how to check if jquery element is loaded 
Javascript :: vscode php format brackets 
Javascript :: variables are used to store data values. 
Javascript :: change to kebabcase in javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =