• Resolved rstar1web

    (@rstar1web)


    No offense meant, but is there some way to NOT have the Otter blocks show up first in the block inserter? I’d much rather have recently used or common blocks like TEXT listed first.

Viewing 1 replies (of 1 total)
  • Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @rstar1web,

    You can add the following PHP code to your theme’s functions.php or a single use plugin:

    add_filter( 'block_categories_all', function( $categories, $block_editor_context ) {
        // Define the slugs of the categories you want to move
        $custom_slugs = array('themeisle-blocks', 'themeisle-woocommerce-blocks');
    
        // Separate the custom categories
        $custom_categories = array_filter($categories, function($category) use ($custom_slugs) {
            return in_array($category['slug'], $custom_slugs);
        });
    
        // Remove the custom categories from the original list
        $categories = array_filter($categories, function($category) use ($custom_slugs) {
            return !in_array($category['slug'], $custom_slugs);
        });
    
        // Append the custom categories to the end
        return array_merge($categories, $custom_categories);
    }, 99, 2);

    This should take care of it.

    Also, you can use / keyword to add blocks quickly as that is much faster than using the Inseter.

    Hope it helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Block inserter order’ is closed to new replies.