From 7052381a0efeb014d612d2fe16ba4bef9b477588 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Wed, 11 Sep 2024 11:55:35 -0400 Subject: [PATCH] Navigation: Add "Log in" link to local nav (#708) See https://github.com/WordPress/wporg-mu-plugins/issues/647 --- .../wporg-pattern-directory-2024/inc/block-config.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php index 6ad79704..bf02a3fe 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php @@ -358,6 +358,13 @@ function add_site_navigation_menus( $menus ) { 'label' => __( 'My patterns', 'wporg-patterns' ), 'url' => '/my-patterns/', ); + } else { + global $wp; + $redirect_url = home_url( $wp->request ); + $menu[] = array( + 'label' => __( 'Log in', 'wporg-patterns' ), + 'url' => wp_login_url( $redirect_url ), + ); } $current_status = isset( $wp_query->query['status'] ) ? $wp_query->query['status'] : false;