Jump to Any Site From the Network Admin Toolbar
Adds a small "Find site" search box to the toolbar in Network Admin that searches the sites list by name or address, saving clicks on networks with hundreds of sites.
Opens WPIDE on
Code
if ( ! is_multisite() ) {
return;
}
add_action( 'admin_bar_menu', function ( $bar ) {
if ( ! is_network_admin() || ! current_user_can( 'manage_sites' ) ) {
return;
}
$bar->add_node( array(
'id' => 'wpide-find-site',
'title' => '<form action="' . esc_url( network_admin_url( 'sites.php' ) ) . '" method="get" style="display:inline-flex;align-items:center;height:32px"><label class="screen-reader-text" for="wpide-find-site-q">' . esc_html__( 'Find site' ) . '</label><input type="search" name="s" id="wpide-find-site-q" placeholder="' . esc_attr__( 'Find site…' ) . '" style="height:24px;line-height:1;padding:0 6px;min-height:0;width:160px;color:#1d2327"></form>',
'meta' => array( 'html' => '' ),
) );
}, 100 );
Notes
Uses WordPress's own sites search; press Enter to search.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.