How can I show a Slot/Fill in the block editor

By wrapping everything in a <SlotFillProvider> and rendering MyTestFill it works, here is the code: const { Fill, Slot } = createSlotFill( ‘MyFill’ ); const TestFill = () => <Fill>My item in the editor</Fill>; export default function Edit() { return ( <p { …useBlockProps() }> <SlotFillProvider> <Slot /> { __( ‘Fill Test – hello from … Read more

How to detect if we are in the Site Editor part of the Block Editor (as opposed to editing a Page/Post) in JavaScript?

The Block Editor, in both the context of the editing pages or the Site Editor, actually does provide some simple variables in JavaScript similar to the data that is available via get_current_screen in PHP. Sample variables in Page Editor: var ajaxurl=”/mysite/wp-admin/admin-ajax.php”, pagenow = ‘page’, typenow = ‘page’, adminpage=”post-new-php”, thousandsSeparator=”,”, decimalPoint=”.”, isRtl = 0; Sample variables … Read more

Why is this script not working?

I think the issue that the Google maps API isn’t loading correctly. You need to make sure that the both jQuery and Google maps API are being loaded. https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js http://maps.google.com/maps/api/js It can be any recent version of jQuery, and from any source. Assuming that your jQuery function is contained within your google-maps-address.js file the following … Read more

Masonry grid with bootstrap 4

You are blending the Bootstrap framework and the Masonry.js library, but asking for help troubleshooting the resulting CSS on WordPress StackExchange. You’ll have better luck on Stack Overflow 🙂 This isn’t really a WordPress question. I will say I do notice something odd about your code which is that whatever you’re trying to do with … Read more