From f2ac341e03ee39dd67dc3773bc73b744334dcbef Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Tue, 10 Sep 2024 11:45:13 -0400 Subject: [PATCH] Navigation: Add "Log in" link to local nav See https://github.com/WordPress/wporg-mu-plugins/issues/647 --- .../themes/pub/wporg-plugins-2024/inc/block-config.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/block-config.php b/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/block-config.php index 0956980071..263caa5757 100644 --- a/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/block-config.php +++ b/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/block-config.php @@ -74,6 +74,15 @@ function add_site_navigation_menus( $menus ) { ) ); + if ( ! is_user_logged_in() ) { + global $wp; + $redirect_url = home_url( $wp->request ); + $items['plugins'][] = array( + 'label' => __( 'Log in', 'wporg-plugins' ), + 'url' => wp_login_url( $redirect_url ), + ); + } + /* // Not usually in the menu, but we need to show these somehow. if ( is_tax( 'plugin_section', 'adopt-me' ) ) {