Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

block-editor

Custom taxonomy terms not showing as list Gutenberg Editor

Changing the slug of taxonomy works for me. Don’t know the reason behind it but it works.

Categories custom-taxonomy Tags block-editor, custom-taxonomy

How to extend the gallery block in Gutenberg?

Ok, I’ve been playing with this for a little bit and have managed to change the output of the Gallery block, with the following caveats: The preview does not match the output. I think this is possible but appears to be a bit more involved. Certain classes and markup are required in the output for … Read more

Categories images Tags block-editor, gallery, images

Gutenberg: Is there a way to know if current block is inside InnerBlocks?

getBlockParents will work accurately. You can use getBlockParents with the clientId of the block, getBlockParents will return the all parent blocks id if the current block is under any Blocks. It will return blank if current block is not under any Block here is a method that you can use: const innerBlock = “namespace/block-name”; const … Read more

Categories filters Tags block-editor, filters

Load CSS/Javascript in frontend conditionally if block is used

Well, the styles and scripts you register in your php register_block_type call should only be loaded when the block is in use if i recall correctly. If you want to load additional scripts or styles to be enqueued only if there is a block of type “my-awesome/block-type”, you can use the has_block function in your … Read more

Categories wp-enqueue-script Tags block-editor, wp-enqueue-script, wp-enqueue-style

How would one modify the filtering Gutenberg applies to pasted content?

In my blocks.js , located in wp-includes/js/dist/ I find the RemoveInvalidHTML function, which seems to responsible for removing styles from pasted HTML. /** * Given a schema, unwraps or removes nodes, attributes and classes on HTML. * * @param {string} HTML The HTML to clean up. * @param {Object} schema Schema for the HTML. * … Read more

Categories filters Tags block-editor, filters

Enable Gutenberg on custom post type

For Gutenberg to work in a Custom Post Type you need to enable both the editor in supports (which you already have) and show_in_rest. So add ‘show_in_rest’ => true, to your post registration arguments array.

Categories custom-post-types Tags block-editor, custom-post-types, editor

Check what Gutenberg blocks are in post_content

WordPress 5.0+ has a function for this: parse_blocks(). To see if the first block in the post is the Heading block, you’d do this: $post = get_post(); if ( has_blocks( $post->post_content ) ) { $blocks = parse_blocks( $post->post_content ); if ( $blocks[0][‘blockName’] === ‘core/heading’ ) { } }

Categories post-content Tags block-editor, post-content
Newer posts
← Previous Page1 … Page205 Page206
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress