Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_admin_bar_recovery_mode_menu ›

Seit5.2.0
Veraltetn/v
wp_admin_bar_recovery_mode_menu ( $wp_admin_bar )
Parameter:
  • (WP_Admin_Bar) $wp_admin_bar
    Erforderlich: Ja
Definiert in:
Codex:

Add a link to exit recovery mode when Recovery Mode is active.



Quellcode

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_menu(
		array(
			'parent' => 'top-secondary',
			'id'     => 'recovery-mode',
			'title'  => __( 'Exit Recovery Mode' ),
			'href'   => $url,
		)
	);
}