This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
get_header(); | |
the_post(); | |
$blocks = get_editor_blocks( $post->ID ); | |
if ( empty( $blocks ) ) { | |
echo '<p>No Blocks Found</p>'; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { __ } = wp.i18n; | |
const { Component } = wp.element; | |
const el = wp.element.createElement; | |
export default class Select extends Component { | |
constructor( props ) { | |
super( ...props ); | |
this.selectCallback = this.selectCallback.bind(this); | |
this.state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { __ } = wp.i18n; | |
const { Component } = wp.element; | |
const el = wp.element.createElement; | |
export default function Input( className, id, value, label, changeHandler ) { | |
return el( | |
'div', | |
{ | |
className: className | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { __ } = wp.i18n; | |
const { Component } = wp.element; | |
const el = wp.element.createElement; | |
export class Input extends Component { | |
constructor( props ) { | |
super( ...arguments ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myComponents = myComponents || {}; | |
var el = wp.element.createElement; | |
var __ = wp.i18n.__; | |
myComponents.inputComponent = function( id, attributes, changeCallback ) { | |
return el( | |
'input', | |
{ | |
id: id + '-control', | |
value: attributes.who, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Input from './components/Input.es6'; | |
const { __ } = wp.i18n; | |
const { registerBlockType } = wp.blocks; | |
const el = wp.element.createElement; | |
registerBlockType( 'learn-gutenberg/ex2-react', { | |
title: __( 'Learn Gutenberg Example 2: React', 'learn-gutenberg' ), | |
category: 'widgets', | |
supportHTML: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp.blocks.registerBlockType( 'learn-gutenberg/ex2-plainjs', { | |
title: __( 'Learn Gutenberg Example 2: Plain JS', 'learn-gutenberg' ), | |
category: 'widgets', | |
icon: 'admin-users', | |
keywords: [ | |
__( 'lesson', 'ex2-plainjs' ), | |
__( 'tutorial', 'ex2-plainjs' ), | |
__( 'javascript', 'ex2-plainjs' ) | |
], | |
attributes: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the edit callback for wp.blocks.registerBlockTypes() | |
/** | |
* ES5 | |
* | |
*/ | |
edit: function( props ) { | |
var attributes = props.attributes, | |
setAttributes = props.setAttributes, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( wp ) { | |
var el = wp.element.createElement; | |
var __ = wp.i18n.__; | |
wp.blocks.registerBlockType( 'learn-gutenberg/ex2-vue', { | |
title: __( 'Learn Gutenberg Example 2: VueJS', 'learn-gutenberg' ), | |
category: 'widgets', | |
supportHTML: false, | |
attributes: { | |
who: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $EZData; | |
$group_id = 12; | |
$data = array( | |
'value' => 123, | |
'misc_three' => 'testing', | |
): |
NewerOlder