Skip to content

Commit

Permalink
Navigation: Add "Log in" link to local nav (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle authored Sep 11, 2024
1 parent c86d914 commit 7052381
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7052381

Please sign in to comment.