build
1 year ago
lib
1 year ago
packages
1 year ago
src
1 year ago
README.md
1 year ago
changelog.txt
1 year ago
gutenberg-toolbar.php
1 year ago
gutenberg.php
1 year ago
package-lock.json
1 year ago
package.json
1 year ago
post-content.php
1 year ago
readme.txt
1 year ago
gutenberg.php
75 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Gutenberg |
| 4 | * Plugin URI: https://github.com/WordPress/gutenberg |
| 5 | * Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality. |
| 6 | * Requires at least: 6.1 |
| 7 | * Requires PHP: 5.6 |
| 8 | * Version: 15.8.1 |
| 9 | * Author: Gutenberg Team |
| 10 | * Text Domain: gutenberg |
| 11 | * |
| 12 | * @package gutenberg |
| 13 | */ |
| 14 | |
| 15 | ### BEGIN AUTO-GENERATED DEFINES |
| 16 | define( 'GUTENBERG_VERSION', '15.8.1' ); |
| 17 | define( 'GUTENBERG_GIT_COMMIT', 'fd4b70b653192d237ebb1053954964e5e9bf23a8' ); |
| 18 | ### END AUTO-GENERATED DEFINES |
| 19 | |
| 20 | gutenberg_pre_init(); |
| 21 | |
| 22 | /** |
| 23 | * Display a version notice and deactivate the Gutenberg plugin. |
| 24 | * |
| 25 | * @since 0.1.0 |
| 26 | */ |
| 27 | function gutenberg_wordpress_version_notice() { |
| 28 | echo '<div class="error"><p>'; |
| 29 | /* translators: %s: Minimum required version */ |
| 30 | printf( __( 'Gutenberg requires WordPress %s or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' ), '5.9' ); |
| 31 | echo '</p></div>'; |
| 32 | |
| 33 | deactivate_plugins( array( 'gutenberg/gutenberg.php' ) ); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Display a build notice. |
| 38 | * |
| 39 | * @since 0.1.0 |
| 40 | */ |
| 41 | function gutenberg_build_files_notice() { |
| 42 | echo '<div class="error"><p>'; |
| 43 | _e( 'Gutenberg development mode requires files to be built. Run <code>npm install</code> to install dependencies, <code>npm run build</code> to build the files or <code>npm run dev</code> to build the files and watch for changes. Read the <a href="https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/code/getting-started-with-code-contribution.md">contributing</a> file for more information.', 'gutenberg' ); |
| 44 | echo '</p></div>'; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Verify that we can initialize the Gutenberg editor , then load it. |
| 49 | * |
| 50 | * @since 1.5.0 |
| 51 | */ |
| 52 | function gutenberg_pre_init() { |
| 53 | global $wp_version; |
| 54 | if ( defined( 'GUTENBERG_DEVELOPMENT_MODE' ) && GUTENBERG_DEVELOPMENT_MODE && ! file_exists( __DIR__ . '/build/blocks' ) ) { |
| 55 | add_action( 'admin_notices', 'gutenberg_build_files_notice' ); |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | // Get unmodified $wp_version. |
| 60 | include ABSPATH . WPINC . '/version.php'; |
| 61 | |
| 62 | // Strip '-src' from the version string. Messes up version_compare(). |
| 63 | $version = str_replace( '-src', '', $wp_version ); |
| 64 | |
| 65 | // Compare against major release versions (X.Y) rather than minor (X.Y.Z) |
| 66 | // unless a minor release is the actual minimum requirement. WordPress reports |
| 67 | // X.Y for its major releases. |
| 68 | if ( version_compare( $version, '5.9', '<' ) ) { |
| 69 | add_action( 'admin_notices', 'gutenberg_wordpress_version_notice' ); |
| 70 | return; |
| 71 | } |
| 72 | |
| 73 | require_once __DIR__ . '/lib/load.php'; |
| 74 | } |
| 75 |