Embeds (YouTube, Spotify) Work Live but Won’t Load in Block Editor [closed]
I fixed my own issue by clearing my browser cache. (Ugh. It’s always the simplest thing that I miss.)
I fixed my own issue by clearing my browser cache. (Ugh. It’s always the simplest thing that I miss.)
In the block query settings, it has “inherit”:true. This means the rest of the parameters are ignored and instead the global query is used. You could consider setting inherit to false, or otherwise use filter hooks to change the query as needed, such as pre_get_posts.
Presumably, within your Query Loop block, you also have a Post Template block. When rendering the page server side, there is “barrier” in the context inheritance caused by the render_block_core_post_template(): $block_content = ( new WP_Block( $block_instance ) )->render( array( ‘dynamic’ => false ) ); It renders the content without any of its context (it is … Read more
There is no official public API to inject custom buttons into that area. This can be confirmed by inspecting the source code for this area, rendered by the DocumentTools component in the @wordpress/editor package. As alternatives, you could render a button to the right of the Save/Publish button on the right side. This button would … Read more
It seems like you’re not using a build step to process your custom-terms-block.js. This means you cannot use JSX syntax. Instead, you should replace all instances of JSX with React.createElement(): edit: (props) => { const { terms } = props.attributes; // Fetch terms and their associated ACF brand_logo fields const [taxonomyTerms, error] = useEntityProp(“taxonomy”, “category”, … Read more
And yet, the post meta is stored in the database as a serialized array! This is because all meta values are strings, that’s what the database table schema says. So if you try to pass structured data into it, WordPress tries to be helpful and uses serialize to turn it into a string, then deserialises … Read more
You can try adjusting the post type of the search query with: <!– wp:search { “label”:”Search”, “buttonText”:”Search”, “query” : {“post_type” : “cpt”} } /–> replacing cpt with your custom post type. This will add a hidden input tag, to the search form, for the post_type GET query parameter.
Will get the slug and set up a subscriber to the store so that if the value is changed slug will update and the the component will re-render? That is correct 👍 Subscriptions from 10,000 feet I think the mechanisms behind React hooks and store subscriptions can sometimes seem a bit like black magic, and … Read more
When you call register_post_type() to register your custom post type, one of the args is called template which is described as follows: Array of blocks to use as the default initial state for an editor session. Each item should be an array containing block name and optional attributes. So whereever you have the register_post_type(), you … Read more
I’m just gonna pass the information generated from apiFetch as attributes to the PHP file, thus eliminating the need to do the whole get_terms() loop..