Download the PHP package gebruederheitz/wp-block-updater without Composer

On this page you can find all versions of the php package gebruederheitz/wp-block-updater. 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 wp-block-updater

Wordpress Block Updater

Update dynamic blocks with innerBlocks


Moving from a React-rendered "static" Gutenberg block (where the block editor's save() method returns the markup for the block which gets rendered once and written as static HTML to the post content) to a "dynamic" block (which is rendered by PHP) is trivial. Instead of having save() return the markup, we make it return null and let PHP templates handle the block's frontend output. But there's once exception: When the affected block contains "innerBlocks", their rendering will often still have to be handled by Gutenberg & React, so we simply return <InnerBlocks.Content /> from save() – which will result in invalid blocks, as all existing blocks still contain the full markup, not just the innerBlocks. This package offers a REST interface to update such blocks across posts along with an admin page allowing to run batched updates for all published posts.

Warning

This is not a generic block updater; it will only work correctly for exactly the task described above: Performing a migration of a statically rendered block with innerBlocks to a dynamic block.

Running this tool on a static block will make that block's markup disappear (partially or completely) from your Wordpress frontend!

Running the tool against a dynamic block with no innerBlocks will have no effect.

Installation

via composer:

Make sure you have Composer autoload or an alternative class loader present.

Usage

Instantiate the BlockUpdater, for example in your functions.php, passing it an array of qualifying blocks (i.e. those that have moved from static to dynamic rendering):

Now navigate to wordpress/wp-admin/tools.php?page=ghwp-block-updater, select a block and click "Start" in order to loop over all published posts of types page and post and re-render the block content of the selected block if it exists.

Example Scenario

Before

Now

For any page that is not migrated, this will result in the block being duplicated inside itself, as $content still contains the entire rendered block from before the change.

After

$content will be re-parsed and re-rendered, so it contains only the actual innerBlocks, making the block work in both front- and backend.

Development

Dependencies


All versions of wp-block-updater with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
gebruederheitz/wp-theme-docs Version ^2.0
gebruederheitz/wp-simple-rest Version ^2.2
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 gebruederheitz/wp-block-updater contains the following files

Loading the files please wait ....