TinyMCE Button to Insert Multiple Lines of Text?

This should be as easy as adding <br /> between shortcodes or every time you want to add a new line and also if you are inserting content you should use mceInsertContent instead of mceInsertClipboardContent unless you are actually getting the content from the clipbard, so: tinyMCEPopup.editor.execCommand(‘mceInsertContent’, false, ‘<p>[shotcode1]<br/>[shotcode2]<br/>[shotcode3]</p>’));

Documentation for IDE’s

One possible solution is to make the WordPress source code available to the IDE by adding it’s path to the project. IntelliJ reads the Javascript functions available. This is not a pretty solution though (I’d like someone to be able to load the project on their machine and have this work).

WP Customizer set a value via javascript (to create presets)

The solution is to simply enqueue the JS value syncing snippet so that it is added in the customizer pane (customize.php) instead of the customizer preview window (on the frontend). In other words, enqueue your JS at customize_controls_enqueue_scripts instead of wp_enqueue_scripts. Here’s one snippet: wp.customize( ‘field1’, ‘field2’, function( field1, field2 ) { field1.bind( function( value … Read more

Eliminate render blocking javascript

You can install a plugin to load your JavaScript asynchronously or try to do it manually adding code to your functions.php to load your scripts asynchronously. This can get you started, Warning loading JavaScript asynchronously will cause several issues with dependencies: /*function to add async to all scripts*/ function js_async_attr($tag){ //Add async to all scripts … Read more

Gutenberg extend blocks add new class name

Yes, you can do this via the classnames() function. import classnames from ‘classnames’; const withClass = createHigherOrderComponent( ( BlockListBlock ) => { return ( props ) => { let wrapperProps = props.wrapperProps; wrapperProps = { …wrapperProps, className={ classnames( ‘my-custom-class’, props.className ) } }; return <BlockListBlock { …props } wrapperProps={ wrapperProps } />; }; }, ‘withClass’ … Read more