Skip to content

Commit 0863dc6

Browse files
authored
Merge pull request #19 from Automattic/add/jetpack-beta-blocks-constant
Add setting to define JETPACK_BETA_BLOCKS on the Jetpack Constant page.
2 parents befdc72 + 5cb65f5 commit 0863dc6

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

companion.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Companion Plugin
44
Plugin URI: https://github.com/Automattic/companion
55
Description: Helps keep the launched WordPress in order.
6-
Version: 1.4
6+
Version: 1.5
77
Author: Osk
88
*/
99

@@ -30,7 +30,7 @@ function companion_admin_notices() {
3030
$sysuser_option_key = 'jurassic_ninja_sysuser';
3131
$admin_password = is_multisite() ? get_blog_option( 1, $password_option_key ) : get_option( $password_option_key );
3232
$sysuser = is_multisite() ? get_blog_option( 1, $sysuser_option_key ) : get_option( $sysuser_option_key );
33-
$host = parse_url( network_site_url(), PHP_URL_HOST );
33+
$host = parse_url( network_site_url(), PHP_URL_HOST );
3434
?>
3535
<div class="notice notice-success is-dismissible">
3636
<h3><?php echo esc_html__( 'Welcome to Jurassic Ninja!' ); ?></h3>
@@ -46,7 +46,7 @@ function companion_admin_notices() {
4646
</div>
4747
<style type="text/css">
4848
#jurassic_ssh_command {
49-
user-select: all;
49+
user-select: all;
5050
}
5151
</style>
5252
<?php
@@ -153,6 +153,13 @@ function companion_add_jetpack_constants_option_page() {
153153
),
154154
'placeholder' => esc_attr( $jetpack_sandbox_domain ),
155155
),
156+
'jetpack_beta_blocks' => array(
157+
'id' => 'jetpack_beta_blocks',
158+
'title' => __( 'JETPACK_BETA_BLOCKS', 'companion' ),
159+
'text' =>
160+
esc_html__( 'Check to enable Jetpack blocks for Gutenberg that are on Beta stage of development', 'companion' ),
161+
'type' => 'checkbox',
162+
),
156163
'jetpack_protect_api_host' => array(
157164
'id' => 'jetpack_protect_api_host',
158165
'title' => __( 'JETPACK_PROTECT__API_HOST', 'companion' ),
@@ -213,4 +220,7 @@ function companion_tamper_with_jetpack_constants() {
213220
if ( companion_get_option( 'jetpack_protect_api_host', '' ) ) {
214221
define( 'JETPACK_PROTECT__API_HOST', companion_get_option( 'jetpack_protect_api_host', '' ) );
215222
}
223+
if ( companion_get_option( 'jetpack_beta_blocks', '' ) ) {
224+
define( 'JETPACK_BETA_BLOCKS', companion_get_option( 'jetpack_beta_blocks', '' ) ? true : false );
225+
}
216226
}

0 commit comments

Comments
 (0)