Menus that adds a search item to a classic * menu: a custom link to `#searcio` with the class `searcio-open`, which the * storefront opens the search from. Its label is the admin's to change, like * any menu item's. * * The box is drawn as WordPress draws its own: a checklist in a * `posttype-*` panel with a "Add to menu" button whose id names it, which is * what the menu screen's script reads the selected items from. * * @author Mir Mohammad Hosseini * @copyright 2026 webhead GmbH */ declare( strict_types=1 ); namespace Webhead\WP\SearchCloud\Admin; use Webhead\WP\SearchCloud\Frontend\Site_Placement; use Webhead\WP\SearchCloud\Dependencies\Webhead\WP\Framework\Attributes\Action; defined( 'ABSPATH' ) || exit; /** * @since 1.4.0 */ final class Menu_Item { private const PANEL = 'posttype-searcio'; #[Action( 'admin_head-nav-menus.php' )] public function add_meta_box(): void { add_meta_box( 'searcio-menu-item', __( 'Searcio', 'searcio' ), [ $this, 'render' ], 'nav-menus', 'side', 'low' ); } public function render(): void { $label = __( 'Search', 'searcio' ); ?>