Download the PHP package bernskioldmedia/block-plugin-support without Composer

On this page you can find all versions of the php package bernskioldmedia/block-plugin-support. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package block-plugin-support

THIS REPOSITORY WILL GO INTO READ-ONLY MODE

We have integrated this composer package into our wp-plugin-base instead of keeping it separate.

Block Plugin Support

We find ourselves increasingly creating a bunch of plugins that add one or more blocks to the block editor.

This requires a few functions to load and register. And since we use the same scaffold almost any time, it makes sense to split out the block part into a library.

The library consists of a simple trait for making the plugin support blocks and two abstract classes for a base server-side rendered block.

Getting started

All you need to do is include the Has_Blocks trait in the plugin class as long as you are using the latest version of our plugin base, which recognizes this trait automatically.

Blocks are assumed to be placed in a blocks subfolder, and they are being built to dist/blocks.

This trait relies on an autoloader being used in the plugin!

Defining a custom block prefix

The trait will default to using the 'bm' prefix for blocks. Blocks are named with a prefix to scope them to the project they are a part of. This also influences how the script and style handles are registered ($prefix-block-$block_name).

Your project probably requires its custom prefix. You can set it on the main plugin class like so:

Required Folder Structure

The trait assumes the following folder structure:

blocks/ is the location of all blocks with one folder per block. The index.js file in each block folder is the entrypoint for the build script.

dist/blocks is the location of built JavaScript blocks with the same filename as the main folder name.

languages/ is the location of the translation files. The handle and domain are both set to {$block_prefix}-{$block_name}.

Required Methods

The trait relies on two methods to be implemented.

Hooks & Filters

We strive to make all code easily customizable with plenty of filters and hooks as needed. You never know when or why you might need that simple one-off customization.

Since this is a composer package, filters are housed inside of the "package namespace" and do not inherit the consumer plugin's own naming structure.

Filters

bm_block_support_{$BLOCKNAME}_wrapper_args. Available for any dynamic block that extends Block and is reliant on Block::$name being set in the consuming dynamic block class. Allows you to customize the args sent to get_block_wrapper_attributes.


All versions of block-plugin-support with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bernskioldmedia/block-plugin-support contains the following files

Loading the files please wait ....