wp-includes/script-loader.php:3498Enqueues the assets required for the Command Palette.
function wp_enqueue_command_palette_assets() { global $menu, $submenu; $command_palette_settings = array( 'is_network_admin' => is_network_admin(), ); /** * Extracts root-level text nodes from HTML string. * * @ignore * @param string $label HTML string to extract text from. * @return string Extracted text content, trimmed. */ $extract_root_text = static function ( string $label ): string { if ( '' === $label ) { return ''; } $processor = new WP_HTML_Tag_Processor( $label ); $text_parts = array(); $depth = 0; while ( $processor->next_token() ) { $token_type = $processor->get_token_type(); if ( '#text' === $token_type ) { if ( 0 === $depth ) { $text_parts[] = $processor->get_modifiable_text(); } continue; } if ( '#tag' !== $token_type ) { continue; } if ( $processor->is_tag_closer() ) { if ( $depth > 0 ) { --$depth; } continue; } $token_name = $processor->get_tag(); if ( $token_name && ! WP_HTML_Processor::is_void( $token_name ) ) { ++$depth; } } return trim( implode( '', $text_parts ) ); }; if ( $menu ) { $menu_commands = array(); foreach ( $menu as $menu_item ) { if ( empty( $menu_item[0] ) || ! is_string( $menu_item[0] ) || ! empty( $menu_item[1] ) && ! current_user_can( $menu_item[1] ) ) { continue; } $menu_label = $extract_root_text( $menu_item[0] ); $menu_url = ''; $menu_slug = $menu_item[2]; if ( preg_match( '/\.php($|\?)/', $menu_slug ) || wp_http_validate_url( $menu_slug ) ) { $menu_url = $menu_slug; } elseif ( ! empty( menu_page_url( $menu_slug, false ) ) ) { $menu_url = WP_HTML_Decoder::decode_attribute( menu_page_url( $menu_slug, false ) ); } if ( $menu_url ) { $menu_commands[] = array( 'label' => $menu_label, 'url' => $menu_url, 'name' => $menu_slug, ); } if ( array_key_exists( $menu_slug, $submenu ) ) { foreach ( $submenu[ $menu_slug ] as $submenu_item ) {Introduced in 6.9.0. Unchanged from 6.9.7 through 7.1.0.
Signature, return type and hooks compared across 3 parsed releases.
src/wp-includes/script-loader.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.