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
diff --git a/editor/components/inserter/index.js b/editor/components/inserter/index.js | |
index 82372dd82..54de2ac6b 100644 | |
--- a/editor/components/inserter/index.js | |
+++ b/editor/components/inserter/index.js | |
@@ -88,7 +88,7 @@ export default compose( [ | |
withSelect( ( select ) => ( { | |
insertionPoint: select( 'core/editor' ).getBlockInsertionPoint, | |
selectedBlock: select( 'core/editor' ).getSelectedBlock, | |
- } ) ), | |
+ } ), { pure: false } ), |
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
/** | |
* WordPress dependencies | |
*/ | |
import { registerStore } from '@wordpress/data'; | |
/** | |
* Internal dependencies | |
*/ | |
import reducer from './reducer'; | |
import * as actions from './actions'; |
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 BlockMobileToolbar( { uid, renderBlockMenu } ) { | |
return ( | |
<div className="editor-block-list__block-mobile-toolbar"> | |
<VisualEditorInserter /> | |
<BlockMover uids={ [ uid ] } /> | |
<BlockRemoveButton uids={ [ uid ] } small /> | |
<BlockSettingsMenu uids={ [ uid ] } renderBlockMenu={ renderBlockMenu } /> | |
</div> | |
); | |
} |
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( blocks, element ) { | |
var el = element.createElement; | |
function Stars( { stars } ) { | |
return el( 'div', { key: 'stars' }, | |
'★'.repeat( stars ), | |
( ( stars * 2 ) % 2 ) ? '½' : '' ); | |
} | |
blocks.registerBlockType( 'stars/stars-block', { |
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
<?php | |
/** | |
* Plugin Name: Demo CPT | |
*/ | |
add_action( 'init', function() { | |
register_post_type( 'book', [ | |
'label' => 'Book', | |
'show_in_rest' => true, |
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
<?php | |
// NOTE: It would normally be recommended to split a block's JavaScript | |
// implementation to a separate file, but is authored here in a single | |
// file for convenience's sake. | |
// | |
// See: https://github.com/WordPress/gutenberg/pull/2791 | |
/** | |
* Plugin Name: Stars Block |
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
var moize = require( 'moize' ); | |
var memoized = moize((item) => { | |
return item; | |
}); | |
try { | |
memoized.clear(); | |
} catch ( error ) { | |
document.write( error.stack ); |
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
const stringsReplaced = [ | |
'You must pass either a function or an object of options as the first parameter to moize.', | |
'You have not specified a promiseLibrary, and it appears that your browser does not support ' + | |
'native promises. You can either assign the library you are using to the global Promise object, or pass ' + | |
'the library in options via the "promiseLibrary" property.' | |
]; | |
function getBinaryExpressionString( node ) { | |
return [ node.left, node.right ].reduce( ( result, operand ) => { | |
if ( operand.type === 'BinaryExpression' ) { |
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
// ==UserScript== | |
// @name GitHub Permalink Shortener | |
// @namespace https://andrewduthie.com | |
// @version 0.1 | |
// @description Shortens GitHub permalink ("Y" hotkey) | |
// @author Andrew Duthie | |
// @match https://github.com/* | |
// @grant MIT | |
// ==/UserScript== |
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
<template> | |
<div class="hello"> | |
<h1>{{ msg }}</h1> | |
<h2>Essential Links</h2> | |
<ul> | |
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li> | |
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li> | |
<li><a href="https://gitter.im/vuejs/vue" target="_blank">Gitter Chat</a></li> | |
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li> | |
<br> |