Giter Site home page Giter Site logo

pewresearch / convert-to-blocks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 10up/convert-to-blocks

0.0 0.0 0.0 6.06 MB

Convert to Blocks is a WordPress plugin that transforms classic editor content to blocks on the fly.

Home Page: https://wordpress.org/plugins/convert-to-blocks/

License: GNU General Public License v2.0

Shell 8.38% JavaScript 16.32% PHP 75.30%

convert-to-blocks's Introduction

Convert to Blocks

Transforms classic editor content to blocks on-the-fly.

Support Level WordPress Plugin Version WordPress Plugin: Tested WP Version WordPress Plugin Required PHP Version WordPress Plugin: Required WP Version GPL-2.0-or-later License

E2E test Linting Dependency Review

Overview

Convert to Blocks is a WordPress plugin that transforms classic editor content to blocks on-the-fly. After installing Gutenberg or upgrading to WordPress 5.0+, your content will be displayed in "Classic Editor Blocks". While these blocks are completely functional and will display fine on the frontend of your website, they do not empower editors to fully make use of the block editing experience. In order to do so, your classic editor posts need to be converted to blocks. This plugin does that for you "on the fly". When an editor goes to edit a classic post, the content will be parsed into blocks. When the editor saves the post, the new structure will be saved into the database. This strategy reduces risk as you are only altering database values for content that needs to be changed.

When combined with the Block Catalog Plugin, Convert to Blocks can be used to bulk convert only classic editor content to blocks. This is especially useful for sites with a combination of classic and block editor content.

Bulk migration of Classic Editor items to the Block Editor

The wp convert-to-blocks start WP-CLI command that converts posts iteratively in the browser without requiring any manual input. One caveat worth mentioning is that Gutenberg is a CPU intensive application. You will want to keep your computer plugged in before doing this!

Demo of WP-CLI command

Requirements

  • Inner Blocks Transforms is only supported with the Gutenberg Plugin 10.9.0+

Installation

  1. Clone the repository into your /plugins directory.
  2. Inside the repository directory, run npm install and then npm run build.
  3. Inside the repository directory, run composer install.

Command Line Options

NAME

  wp convert-to-blocks start

DESCRIPTION

  Starts a new Migration. The command prints the URL that must be opened in a browser to connect it to the WP CLI.

SYNOPSIS

  wp convert-to-blocks start [--post_type=<post_type>] [--per_page=<per_page>] [--page=<page>] [--only=<only>] [--catalog] [--reset]

OPTIONS

  [--post_type=<post_type>]
    Optional comma delimited list of post types to migrate. Defaults to post,page

  [--per_page=<per_page>]
    Optional number of posts to migrate per batch. Defaults to no limit. Combine with --page to paginate.

  [--page=<page>]
    Optional page number to start migration from. Defaults to 1.

  [--only=<only>]
    Optional comma delimited list of post ids to migrate.

  [--catalog]
    Optional flag to only migrate classic editor tagged posts. Requires that Block
    Catalog plugin is present and has been indexed.

  [--reset]
    Stops any currently running migration and resets the migration state.

NAME

  wp convert-to-blocks stop

DESCRIPTION

  Stops the currently running migration if active.

NAME

  wp convert-to-blocks status

DESCRIPTION

  Prints the status of the currently running migration.

Frequently Asked Questions

How Do I Know It's Working?

Find a classic editor in the post, try to navigate away from the page. You will get an error saying your changes will be discarded. This is because Convert to Blocks converted your content to blocks on the fly and those changes will be saved when you update the post.

Will Convert to Blocks Handle My Custom Blocks?

By default it will not.

Will Convert to Blocks Handle Nested Blocks?

Nested / Inner Block support does not work with Gutenberg bundled with WordPress Core <=5.7.2. This feature needs the Gutenberg Plugin >=10.9.0.

Support Level

Stable: 10up is not planning to develop any new features for this, but will still respond to bug reports and security concerns. We welcome PRs, but any that include new features should be small and easy to integrate and should not include breaking changes. We otherwise intend to keep this tested up to the most recent version of WordPress.

Changelog

A complete listing of all notable changes to Convert to Blocks are documented in CHANGELOG.md.

Contributing

Please read CODE_OF_CONDUCT.md for details on our code of conduct, CONTRIBUTING.md for details on the process for submitting pull requests to us, and CREDITS.md for a listing of maintainers of, contributors to, and libraries used by Convert to Blocks.

Like what you see?

convert-to-blocks's People

Contributors

jeffpaul avatar sidsector9 avatar dkotter avatar dependabot[bot] avatar tlovett1 avatar dsawardekar avatar ravinderk avatar dinhtungdu avatar barneyjeffries avatar akshitsethi avatar jayedul avatar mehul0810 avatar peterwilsoncc avatar iamdharmesh avatar cadic avatar kmgalanakis avatar zamanq avatar barryceelen avatar c0ntax avatar tylerb24890 avatar ankitguptaindia avatar faisal-alvi avatar hashimwarren avatar petersorensen10up avatar rodrigo-arias avatar

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.