get selected categories or tags (using javascript) in GutenBerg?

To get the categories from inside the editor of a post you can make use of the following selectors: The categories the post has in the published version: wp.data.select(“core/editor”).getCurrentPostAttribute(“categories”) The current categories of the edit (for example if the user has selected a new category but hasn’t saved the post it will appear with this … Read more

Dynamic gutenberg block with react instead of php

Gutenberg is not intended to do dynamic React stuff in front-end. Nevertheless there is a way to bypass this problem: I assume the structure of gutenberg block when using npm init @wordpress/block my-block to init your block. You have to register your own client-side script in my-block.php to be executed on front-end; one drawback: it … Read more

Serialize custom block with InnerBlock

What you asked for is not possible for blocks that rely on frontend javascript, this includes embeds. It’s also not possible using the Swiper react library. The Swiper library made the questionable choice of manually inspecting child components for the SwiperSlide component name, preventing it from ever being used with child blocks. Edit: Actually maybe … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)