Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation: Remove filters disabling tabs for link and submenu #47593

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,38 +372,6 @@ function register_block_core_navigation_link() {
}
add_action( 'init', 'register_block_core_navigation_link' );

/**
* Disables the display of block inspector tabs for the Navigation Link block.
*
* This is only a temporary measure until we have a TabPanel and mechanism that
* will allow the Navigation Link to programmatically select a tab when edited
* via a specific context.
*
* See:
* - https://github.com/WordPress/gutenberg/issues/45951
* - https://github.com/WordPress/gutenberg/pull/46321
* - https://github.com/WordPress/gutenberg/pull/46271
*
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function gutenberg_disable_tabs_for_navigation_link_block( $settings ) {
$current_tab_settings = _wp_array_get(
$settings,
array( 'blockInspectorTabs' ),
array()
);

$settings['blockInspectorTabs'] = array_merge(
$current_tab_settings,
array( 'core/navigation-link' => false )
);

return $settings;
}

add_filter( 'block_editor_settings_all', 'gutenberg_disable_tabs_for_navigation_link_block' );

/**
* Enables animation of the block inspector for the Navigation Link block.
*
Expand Down
32 changes: 0 additions & 32 deletions packages/block-library/src/navigation-submenu/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,38 +290,6 @@ function register_block_core_navigation_submenu() {
}
add_action( 'init', 'register_block_core_navigation_submenu' );

/**
* Disables display of block inspector tabs for the Navigation Submenu block.
*
* This is only a temporary measure until we have a TabPanel and mechanism that
* will allow the Navigation Submenu to programmatically select a tab when
* edited via a specific context.
*
* See:
* - https://github.com/WordPress/gutenberg/issues/45951
* - https://github.com/WordPress/gutenberg/pull/46321
* - https://github.com/WordPress/gutenberg/pull/46271
*
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function gutenberg_disable_tabs_for_navigation_submenu_block( $settings ) {
$current_tab_settings = _wp_array_get(
$settings,
array( 'blockInspectorTabs' ),
array()
);

$settings['blockInspectorTabs'] = array_merge(
$current_tab_settings,
array( 'core/navigation-submenu' => false )
);

return $settings;
}

add_filter( 'block_editor_settings_all', 'gutenberg_disable_tabs_for_navigation_submenu_block' );

/**
* Enables animation of the block inspector for the Navigation Submenu block.
*
Expand Down