Use page Title in Gutenberg custom banner block

Due to the getDocumentTitle selector being deprecated as mentioned here https://stackoverflow.com/questions/51674293/use-page-title-in-gutenberg-custom-banner-block/51792096#comment92130728_51792096 I managed to get it working with a slight tweak to the code by Jim-miraidev var GetTitle = function GetTitle(props) { return el(“h1”, {className: “jab-banner-title”}, props.title); }; var selectTitle = withSelect(function (select) { var title; if (typeof select(“core/editor”).getPostEdits().title !== ‘undefined’) { title = select(“core/editor”).getPostEdits().title; … Read more

Hide or show Gutenberg custom block using date range

Here’s an untested suggestion, to remove an HTML block of type: <!– wp:block/timed-block {“dateFrom”:”2018-11-14″, “dateTo”:”2018-12-18″} –> <section> … </section> <!– /wp:block/timed-block –> from the rendered content, using the render_block filter (available in 5.0+): add_filter( ‘render_block’, function( $block_content, $block ) { // Remove the block/timed-block from the rendered content. if ( ‘block/timed-block’ === $block[‘blockName’] ) { … Read more

Add classname to Gutenberg block wrapper in the editor?

Actually it can be done with the filter: const { createHigherOrderComponent } = wp.compose; const withCustomClassName = createHigherOrderComponent( ( BlockListBlock ) => { return ( props ) => { if(props.attributes.size) { return <BlockListBlock { …props } className={ “block-” + props.attributes.size } />; } else { return <BlockListBlock {…props} /> } }; }, ‘withClientIdClassName’ ); wp.hooks.addFilter( … Read more

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş