Skip to content

Commit

Permalink
Navigation: Add "Log in" link to local nav
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Sep 10, 2024
1 parent c86d914 commit c6af38c
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 c6af38c

Please sign in to comment.