Skip to content
Merged
1 change: 1 addition & 0 deletions backport-changelog/7.0/10909.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ https://github.com/WordPress/wordpress-develop/pull/10909
* https://github.com/WordPress/gutenberg/pull/72215
* https://github.com/WordPress/gutenberg/pull/74943
* https://github.com/WordPress/gutenberg/pull/75526
* https://github.com/WordPress/gutenberg/pull/75576
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WP_Icons_Registry {
* WP_Icons_Registry is a singleton class, so keep this private.
*/
private function __construct() {
$icons_directory = __DIR__ . '/../../packages/icons/src/';
$icons_directory = __DIR__ . '/../../../packages/icons/src/';
$icons_directory = trailingslashit( $icons_directory );
$manifest_path = $icons_directory . 'manifest.php';

Expand Down
5 changes: 0 additions & 5 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ function gutenberg_enable_block_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-block-experiments', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableBlockExperiments = true', 'before' );
}

// Adding explicit support for the Icon block if the SVG icon registry is active.
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-svg-icon-registry', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableIconBlock = true', 'before' );
}
}

add_action( 'admin_init', 'gutenberg_enable_block_experiments' );
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,6 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-svg-icon-registry',
__( 'SVG Icon Registration API', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enables a REST API endpoint for accessing SVG icons as well as the associated Icon block.', 'gutenberg' ),
'id' => 'gutenberg-svg-icon-registry',
)
);

register_setting(
'gutenberg-experiments',
'gutenberg-experiments'
Expand Down
7 changes: 2 additions & 5 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/compat/wordpress-7.0/class-gutenberg-rest-block-patterns-controller-7-0.php';
require __DIR__ . '/compat/wordpress-7.0/class-gutenberg-rest-templates-controller-7-0.php';
require __DIR__ . '/compat/wordpress-7.0/class-gutenberg-rest-static-templates-controller.php';
require __DIR__ . '/compat/wordpress-7.0/class-wp-icons-registry.php';
require __DIR__ . '/compat/wordpress-7.0/class-wp-rest-icons-controller.php';
require __DIR__ . '/compat/wordpress-7.0/collaboration.php';
require __DIR__ . '/compat/wordpress-7.0/template-activate.php';
require __DIR__ . '/compat/wordpress-7.0/rest-api.php';
Expand Down Expand Up @@ -199,8 +201,3 @@ function gutenberg_is_experiment_enabled( $name ) {

// Block patterns for navigation overlays.
require __DIR__ . '/overlay-patterns.php';

if ( gutenberg_is_experiment_enabled( 'gutenberg-svg-icon-registry' ) ) {
require __DIR__ . '/experimental/class-wp-icons-registry.php';
require __DIR__ . '/experimental/class-wp-rest-icons-controller.php';
}
10 changes: 4 additions & 6 deletions lib/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ function gutenberg_register_edit_site_export_controller_endpoints() {
/**
* Registers the Icons Registry REST API routes.
*/
if ( gutenberg_is_experiment_enabled( 'gutenberg-svg-icon-registry' ) ) {
function gutenberg_register_icon_controller_endpoints() {
$icons_registry = new WP_REST_Icons_Controller();
$icons_registry->register_routes();
}
add_action( 'rest_api_init', 'gutenberg_register_icon_controller_endpoints' );
function gutenberg_register_icon_controller_endpoints() {
$icons_registry = new WP_REST_Icons_Controller();
$icons_registry->register_routes();
}
add_action( 'rest_api_init', 'gutenberg_register_icon_controller_endpoints' );
5 changes: 1 addition & 4 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ const getAllBlocks = () => {
postCommentsForm,
tableOfContents,
homeLink,
icon,
logInOut,
navigationOverlayClose,
termCount,
Expand Down Expand Up @@ -295,10 +296,6 @@ const getAllBlocks = () => {
blocks.push( playlistTrack );
}

if ( window?.__experimentalEnableIconBlock ) {
blocks.push( icon );
}

// When in a WordPress context, conditionally
// add the classic block and TinyMCE editor
// under any of the following conditions:
Expand Down
1 change: 0 additions & 1 deletion phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ function fail_if_died( $message ) {
'gutenberg-form-blocks' => 1,
'gutenberg-block-experiments' => 1,
'gutenberg-media-processing' => 1,
'gutenberg-svg-icon-registry' => 1,
),
);

Expand Down
3 changes: 0 additions & 3 deletions test/integration/full-content/full-content.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ describe( 'full post content fixture', () => {
// Form-related blocks will not be registered unless they are opted
// in on the experimental settings page.
window.__experimentalEnableFormBlocks = true;
// Icon block will not be registered unless are opted into on the
// experimental settings page.
window.__experimentalEnableIconBlock = true;
registerCoreBlocks();

if ( globalThis.IS_GUTENBERG_PLUGIN ) {
Expand Down
Loading