Skip to content

sarahcssiqueira/wxyz-blocks

Repository files navigation

WXYZ Blocks

Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: GPL v2 Release Version

Structure to work with multiple Gutenberg blocks in plugin. Contains four main blocks.

Table of Contents

Requirements

  • WordPress Environment
  • Node.js 14.0.0 or later
  • Npm 6.14.4 or later.
  • It is not compatible with older versions.

Blocks

Block W

Receives an attribute and displays it in frontend.

Block X

Show latest posts.

Block Y

Retrieve and display data from an API.

Block Z

Slider image.

Custom block category

By default, the WordPress core provides some categories which you can assign to your Gutenberg blocks. However, to keep things organized, can be a good idea to create custom block categories for categorizing your plugin, categorize your blocks based on some features, etc.

To achieve that, you can create your custom block category using the WordPress block filter block_categories_all.

Example: register_new_category function:

       function register_new_category ($categories) {
            $categories[] = array(
                'slug'  => 'custom-category',
                'title' => 'Custom Category'
            );

            return $categories;
        }

        add_filter( 'block_categories_all' , 'register_new_category');

Usage

Clone this repository git clone https://github.com/sarahcssiqueira/wxyz-blocks or download the latest release.

Run npm install && npm run build

Run composer install

License

This project is licensed under the license GPLv2 or later.

About

Multiple Gutenberg blocks in a single WordPress plugin, with custom category

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published