Globally update pattern styles

Is it general understanding that patterns should be updated manually across all pages if it is updated in one page? Yes. Block Patterns are essentially shortcuts for adding a collection of blocks all at once. Once the blocks are inserted they exist as independent blocks just like any others. There’s no meaningful difference in the … Read more

How to add readable name and description to templates?

To add a readable title to a template, we can add the following to theme.json “customTemplates”: [ { “name”: “single-post-type-name”, “title”: “Single Post Type Name” }, … But as Will mentioned in the comments, it is not possible to add descriptions yet. There is an issue to track it here: https://github.com/WordPress/gutenberg/issues/44097

How to get post ID after removing that post?

There’s only one way I can see that you can get the ID after a post is deleted. If you’re using wp_delete_post to delete posts, you add a after_delete_post action hook where you will then do the other stuff that you need to do like the remove of page from sitemap, etc. The hook has … Read more

Some CSS classes missing when rendering the page with get_the_content()

You can achieve that by applying the the_content filters, just like what the_content() does: $content = get_the_content(); $content = apply_filters( ‘the_content’, $content ); $content = str_replace( ‘]]>’, ‘]]>’, $content ); echo $content; Or the other way is by applying do_blocks() on the content: $content = get_the_content(); $content = do_blocks( $content ); echo $content;

I want to add category slug in posts url

Go to permalink settings and select “Custom Structure” option listed on end. Then write /%category%/%postname%/. Save changes and now your post url will have category name too.

wp_add_object_terms cant recognize a post ID

With: wp_add_object_terms( $cpt_dates_post_ID, intval($manifestation_insert_id), ‘cpt_dates_postID’); You’re actually saying “Add a cpt_dates_postID term with ID intval($manifestation_insert_id) to the CPT with ID $cpt_dates_post_ID“. That won’t work, because intval($manifestation_insert_id) is the ID of: another post (from another CPT, freshly inserted with […] Not the ID of an existing $cpt_dates_post_ID term entry. The reason why these 2 work: wp_add_object_terms( … Read more

Is there a way to check if the ‘wp_sitemaps_enabled’ is true or false?

The wp_sitemaps_enabled filter is filtering the value returned by WP_Sitemaps::sitemaps_enabled(). You can get the global instance of WP_Sitemaps with wp_sitemaps_get_server, which means you can get the value of sitemaps_enabled() like this: $sitemaps = wp_sitemaps_get_server(); $enabled = $sitemaps->sitemaps_enabled(); if ( $enabled ) { }