PluginProbe
Gutenberg / 23.9.1
Gutenberg v23.9.1
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / gutenberg.php

gutenberg.php in Gutenberg 23.9.1, at gutenberg.php

75 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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.9
7 * Requires PHP: 7.4
8 * Version: 23.9.1
9 * Author: Gutenberg Team
10 * Text Domain: gutenberg
11 *
12 * @package gutenberg
13 */
14
15 defined( 'GUTENBERG_MINIMUM_WP_VERSION' ) or define( 'GUTENBERG_MINIMUM_WP_VERSION', '6.9' );
16
17 gutenberg_pre_init();
18
19 /**
20 * Display a version notice and deactivate the Gutenberg plugin.
21 *
22 * @since 0.1.0
23 */
24 function gutenberg_wordpress_version_notice() {
25 echo '<div class="error"><p>';
26 /* translators: %s: Minimum required version */
27 printf( __( 'Gutenberg requires WordPress %s or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' ), GUTENBERG_MINIMUM_WP_VERSION );
28 echo '</p></div>';
29
30 deactivate_plugins( array( plugin_basename( __FILE__ ) ) );
31 }
32
33 /**
34 * Display a build notice.
35 *
36 * @since 0.1.0
37 */
38 function gutenberg_build_files_notice() {
39 echo '<div class="error"><p>';
40 _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' );
41 echo '</p></div>';
42 }
43
44 /**
45 * Verify that we can initialize the Gutenberg editor , then load it.
46 *
47 * @since 1.5.0
48 *
49 * @global string $wp_version The WordPress version string.
50 *
51 */
52 function gutenberg_pre_init() {
53 global $wp_version;
54 if ( ! file_exists( __DIR__ . '/build/scripts/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, GUTENBERG_MINIMUM_WP_VERSION, '<' ) ) {
69 add_action( 'admin_notices', 'gutenberg_wordpress_version_notice' );
70 return;
71 }
72
73 require_once __DIR__ . '/lib/load.php';
74 }
75