Skip to content

Commit

Permalink
Remove the gutenberg-block-directory experimental flag (#23389)
Browse files Browse the repository at this point in the history
* Remove the gutenberg-block-directory experimental flag

This removes the flag and its UI, enabling the block directory by default.

Note that it does not change the API namespace, which is still `__experimental`.

* Remove the experiment toggle in block directory e2e.

* Move e2e tests into the editor folder and out of experiments.

Co-authored-by: dufresnesteven <steve.dufresne@automattic.com>
  • Loading branch information
2 people authored and noisysocks committed Jun 24, 2020
1 parent 37d37ba commit 017adf8
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion lib/block-directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

if (
gutenberg_is_experiment_enabled( 'gutenberg-block-directory' ) &&
! has_action( 'admin_enqueue_scripts', 'enqueue_block_editor_assets_block_directory' )
) {
/**
Expand Down
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@ function gutenberg_initialize_experiments_settings() {
'id' => 'gutenberg-navigation',
)
);
add_settings_field(
'gutenberg-block-directory',
__( 'Block Directory', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enable block directory search', 'gutenberg' ),
'id' => 'gutenberg-block-directory',
)
);
add_settings_field(
'gutenberg-full-site-editing',
__( 'Full Site Editing', 'gutenberg' ),
Expand Down Expand Up @@ -143,7 +132,6 @@ function gutenberg_display_experiment_section() {
function gutenberg_experiments_editor_settings( $settings ) {
$experiments_settings = array(
'__experimentalEnableLegacyWidgetBlock' => gutenberg_is_experiment_enabled( 'gutenberg-widget-experiments' ),
'__experimentalBlockDirectory' => gutenberg_is_experiment_enabled( 'gutenberg-block-directory' ),
'__experimentalEnableFullSiteEditing' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing' ),
'__experimentalEnableFullSiteEditingDemo' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing-demo' ),
);
Expand Down
8 changes: 0 additions & 8 deletions lib/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ function gutenberg_register_rest_widget_areas() {
* @since 6.5.0
*/
function gutenberg_register_rest_block_directory() {
if ( ! gutenberg_is_experiment_enabled( 'gutenberg-block-directory' ) ) {
return;
}

$block_directory_controller = new WP_REST_Block_Directory_Controller();
$block_directory_controller->register_routes();
}
Expand Down Expand Up @@ -159,10 +155,6 @@ function gutenberg_register_rest_customizer_nonces() {
* Registers the Plugins REST API routes.
*/
function gutenberg_register_plugins_endpoint() {
if ( ! gutenberg_is_experiment_enabled( 'gutenberg-block-directory' ) ) {
return;
}

$plugins = new WP_REST_Plugins_Controller();
$plugins->register_routes();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import {
getEditedPostContent,
createJSONResponse,
} from '@wordpress/e2e-test-utils';
/**
* Internal dependencies
*/
import { useExperimentalFeatures } from '../../experimental-features';

// Urls to mock
const SEARCH_URLS = [
Expand Down Expand Up @@ -173,8 +169,6 @@ const matchUrl = ( reqUrl, urls ) => {
};

describe( 'adding blocks from block directory', () => {
useExperimentalFeatures( [ '#gutenberg-block-directory' ] );

beforeEach( async () => {
await createNewPost();
} );
Expand Down
6 changes: 0 additions & 6 deletions phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ function fail_if_died( $message ) {
}
tests_add_filter( 'wp_die_handler', 'fail_if_died' );

$GLOBALS['wp_tests_options'] = array(
'gutenberg-experiments' => array(
'gutenberg-block-directory' => '1',
),
);

// Start up the WP testing environment.
require $_tests_dir . '/includes/bootstrap.php';

Expand Down

0 comments on commit 017adf8

Please sign in to comment.