Git Product home page Git Product logo

wp-block-editor's Introduction

We're Hiring Banner

WordPress Block Editor Scaffold

This project is a template repo for developing WordPress Blocks, Block Patterns, Block Styles and Block Editor Sidebars in an automated and organized fashion.

Project Structure

As a WordPress Plugin, this project follows all requirements necessary for building a plugin; in addition, it uses different package management tools to enable developers to build faster and smarter, using modern web development features.

Composer for managing PHP Dependencies

Aside from the required plugin file, all PHP code is located within the lib directory, which are autoloaded as classes and hooked on plugins_loaded.

Each newly added class must extend the Config class located in the main plugin file, which provides both useful utility methods and ensuring Class registration only occurs once.

Node, NPM and Webpack for JavaScript Dependencies

Much like the WordPress Block Editor project (aka Gutenberg), this plugin uses Node, NPM and Webpack for managing JavaScript dependencies. In addition, automated build processes are included to ensure only those required dependencies are built, and all WordPress scripts are added as dependencies when enqueued.

Installation

This plugin can be installed as a standard WordPress plugin, but it is highly recommended to use as a Must Use WordPress Plugin to ensure Block Editor functionalty does not change by an accidental plugin deactivation.

Install as Must Use plugin

Installing as a Must Use plugin requires an additional step to load the required plugin file. First, add this plugin to the mu-plugins directory and add a file at the top-level of the mu-plugins directory named loader.php. Within loader.php`, simply require the plugin file like so:

require_once __DIR__ . '/wp-block-editor/block-editor.php`;

Please note that this is just an example and there are many ways to require plugins within the Must Use directory. If you already have a file that loads plugins in this directory, then simply requiring within that file will suffice.

More Information

Within other directories of this plugin there are README.md files describing in more detail the requirements for adding Blocks (block-library), Block Patterns (block-patterns), Block Styles (block-styles) and Block Editor Sidebars (sidebars). Please read each to better understand how these are added to the Block Editor.

wp-block-editor's People

Contributors

colorful-tones avatar kopepasah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wp-block-editor's Issues

Verify that Husky works

Lately Husky seems like it is more pain to get working than actually being beneficial in a project. If I recall we ended up not using in our client project for this reason (in recent project). We'll want to verify and test that it is working as expected.

Remove/hide core's default patterns

Right now we have remove_theme_support( 'core-block-patterns' ); in WP Theme Scaffold, but it would be more suitable here.

Plus, with the way things are heading for WP 5.9 There is less of a need at all for the entirety of WP Theme Scaffold's lib/Theme_Setup.php file altogether.

Try: consider adding style guide block patterns

In a recent project we ended up incorporating Figma style guides in to unique patterns, which I think was super helpful for establishing a baseline, as well as visual documentation for client and engineering. It might be good to incorporate an example in this repo? ๐Ÿค”

add more info to root repo README

  • Set up instructions
  • Recommended usage / background / context
  • Links to other internal directory README, e.g. block-patterns/README.md

More block pattern hookup

I think we need to do some more hook up for block patterns to work?

I just added my first pattern and there are no patterns showing in block editor at all. ๐Ÿค”

Try: consider adding in example block pattern categories

In a recent project we ended up having a few common block pattern categories registered, which I think was super helpful (for client and engineering).

	// Block pattern categories.
	const BLOCK_PATTERN_CATEORIES = [
		'general'             => [ 'label' => 'General' ],
		'general-carousels'   => [ 'label' => 'Carousels' ],
		'general-heroes'      => [ 'label' => 'Heroes' ],
		'general-cta'         => [ 'label' => 'Calls-to-Action' ],
		'general-columns'     => [ 'label' => 'Columns' ],
		'general-pricing'     => [ 'label' => 'Pricing' ],
		'general-query-loops' => [ 'label' => 'Query Loops' ],
		'style-guides'         => [ 'label' => 'Style Guides' ],
	];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.