diff --git a/packages/block-library/src/file/index.php b/packages/block-library/src/file/index.php index 26a48ccad98c30..a7011cc9efa348 100644 --- a/packages/block-library/src/file/index.php +++ b/packages/block-library/src/file/index.php @@ -5,23 +5,6 @@ * @package WordPress */ -if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - /** - * Replaces view script for the File block with version using Interactivity API. - * - * @param array $metadata Block metadata as read in via block.json. - * - * @return array Filtered block type metadata. - */ - function gutenberg_block_core_file_update_interactive_view_script( $metadata ) { - if ( 'core/file' === $metadata['name'] ) { - $metadata['viewScript'] = array( 'file:./interactivity.min.js' ); - } - return $metadata; - } - add_filter( 'block_type_metadata', 'gutenberg_block_core_file_update_interactive_view_script', 10, 1 ); -} - /** * When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-file-view` script. * diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 6de09f8dd36aa9..6b9c4fc031506a 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -5,148 +5,6 @@ * @package WordPress */ -// These functions are used for the __unstableLocation feature and only active -// when the gutenberg plugin is active. -if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - /** - * Returns the menu items for a WordPress menu location. - * - * @param string $location The menu location. - * @return array Menu items for the location. - */ - function block_core_navigation_get_menu_items_at_location( $location ) { - if ( empty( $location ) ) { - return; - } - - // Build menu data. The following approximates the code in - // `wp_nav_menu()` and `gutenberg_output_block_nav_menu`. - - // Find the location in the list of locations, returning early if the - // location can't be found. - $locations = get_nav_menu_locations(); - if ( ! isset( $locations[ $location ] ) ) { - return; - } - - // Get the menu from the location, returning early if there is no - // menu or there was an error. - $menu = wp_get_nav_menu_object( $locations[ $location ] ); - if ( ! $menu || is_wp_error( $menu ) ) { - return; - } - - $menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) ); - _wp_menu_item_classes_by_context( $menu_items ); - - return $menu_items; - } - - - /** - * Sorts a standard array of menu items into a nested structure keyed by the - * id of the parent menu. - * - * @param array $menu_items Menu items to sort. - * @return array An array keyed by the id of the parent menu where each element - * is an array of menu items that belong to that parent. - */ - function block_core_navigation_sort_menu_items_by_parent_id( $menu_items ) { - $sorted_menu_items = array(); - foreach ( (array) $menu_items as $menu_item ) { - $sorted_menu_items[ $menu_item->menu_order ] = $menu_item; - } - unset( $menu_items, $menu_item ); - - $menu_items_by_parent_id = array(); - foreach ( $sorted_menu_items as $menu_item ) { - $menu_items_by_parent_id[ $menu_item->menu_item_parent ][] = $menu_item; - } - - return $menu_items_by_parent_id; - } - - /** - * Add Interactivity API directives to the navigation-submenu and page-list blocks markup using the Tag Processor - * The final HTML of the navigation-submenu and the page-list blocks will look similar to this: - * - *