wp_admin_bar_recovery_mode_menu() WordPress Function
The wp_admin_bar_recovery_mode_menu() function is used to add a new top-level menu item to the WordPress admin bar. This new menu item allows you to quickly enter recovery mode, which is a special mode designed to help you troubleshoot issues with your WordPress site. When you enter recovery mode, all of your WordPress site's plugins and themes are disabled. This can be helpful if you're having issues with a plugin or theme that's causing problems on your site. Recovery mode also disables all of WordPress' built-in caching mechanisms, which can be helpful if you're trying to debug a caching issue. To enter recovery mode, simply click on the new "Recovery Mode" menu item that's added to the WordPress admin bar by this function. You will be prompted to enter your WordPress password. Once you've entered your password, you will be in recovery mode and can start troubleshooting any issues you're having with your WordPress site.
wp_admin_bar_recovery_mode_menu( WP_Admin_Bar $wp_admin_bar ) #
Adds a link to exit recovery mode when Recovery Mode is active.
Parameters
- $wp_admin_bar
(WP_Admin_Bar)(Required)The WP_Admin_Bar instance.
Source
File: wp-includes/admin-bar.php
function wp_admin_bar_recovery_mode_menu( $wp_admin_bar ) { if ( ! wp_is_recovery_mode() ) { return; } $url = wp_login_url(); $url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url ); $url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION ); $wp_admin_bar->add_node( array( 'parent' => 'top-secondary', 'id' => 'recovery-mode', 'title' => __( 'Exit Recovery Mode' ), 'href' => $url, ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.2.0 | Introduced. |