This file contains 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
/** | |
* Generate CSS for Gutenberg's has-*-color, has-*-background-color | |
* and has-*-font-size, based on our colors/sizes. This works on the | |
* frontend and in the backend editor. | |
*/ | |
add_action( 'wp_print_scripts', function() { | |
$string = '<style>'; | |
// color palette |
This file contains 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
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
This file contains 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 xf_insert_image( $html, $id, $caption, $title, $align, $url ) | |
{ | |
$html5 = "<figure id='post-$id media-$id' class='align-$align'>"; | |
$html5 .= "<img src='$url' alt='$title' />"; | |
$html5 .= "<figcaption>$caption</figcaption>"; | |
$html5 .= "</figure>"; | |
return $html5; | |
} |