How to list latest 5 posts from each author from a custom CPT? I want to create a custom Gutenberg block
How to list latest 5 posts from each author from a custom CPT? I want to create a custom Gutenberg block
How to list latest 5 posts from each author from a custom CPT? I want to create a custom Gutenberg block
Execute a PHP Function when a Block is used and access it’s attributes
Blank widgets page after core update – which files to purge cache?
I saw a React.js post on useEffect and then looked for examples on Gutenberg source as follows: … import { useEffect } from ‘@wordpress/element’; … function Test2Edit(props) { … useEffect( () => { setAttributes( { sliderId: clientId } ); }, [ clientId ] ); …
As per the docs, the file passed to render in block.json receives 3 variables: $attributes (array): The block attributes. $content (string): The block default content. $block (WP_Block): The block instance. So you need to output your attributes from $attributes into the HTML, so that your JavaScript can read the values. In this example I put … Read more
load-styles.php generates css rules. How are the generated styles determined and how can I alter them?
You need to set templateLock=”all” on InnerBlocks: <InnerBlocks template={SLIDER_TEMPLATE} templateLock=”all” allowedBlocks={ [ ] } /> This locks the inner blocks to the blocks that were inserted using the template. The user should still be able to add inner blocks to the give-camp/gc-slider-items block, but they will not be able to add, move, or delete the … Read more
If InnerBlocks.Content is empty?
Filtering context for render_block function
Get realtime title and featured image value in WordPress block