Skip to content

Commit 7e89a17

Browse files
committed
Navigation: Add "Log in" link to local nav
Fixes #307
1 parent 642b193 commit 7e89a17

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

themes/wporg-5ftf-2024/inc/block-config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ function add_site_navigation_menus( $menus ) {
4747
'url' => '/my-pledges/',
4848
'className' => 'has-separator',
4949
);
50+
if ( ! is_user_logged_in() ) {
51+
global $wp;
52+
$redirect_url = home_url( $wp->request );
53+
$menu[] = array(
54+
'label' => __( 'Log in', 'wporg-5ftf' ),
55+
'url' => wp_login_url( $redirect_url ),
56+
);
57+
}
5058

5159
return array(
5260
'main' => $menu,

0 commit comments

Comments
 (0)