Skip to content

Commit

Permalink
Navigation: Add "Log in" link to local nav
Browse files Browse the repository at this point in the history
Fixes #307
  • Loading branch information
ryelle committed Sep 12, 2024
1 parent 642b193 commit 7e89a17
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions themes/wporg-5ftf-2024/inc/block-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ function add_site_navigation_menus( $menus ) {
'url' => '/my-pledges/',
'className' => 'has-separator',
);
if ( ! is_user_logged_in() ) {
global $wp;
$redirect_url = home_url( $wp->request );
$menu[] = array(
'label' => __( 'Log in', 'wporg-5ftf' ),
'url' => wp_login_url( $redirect_url ),
);
}

return array(
'main' => $menu,
Expand Down

0 comments on commit 7e89a17

Please sign in to comment.