Skip to content

Commit

Permalink
Navigation: Add "log in" link to local nav (#2885)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle authored Sep 18, 2024
1 parent ed7c0cc commit 4031ca9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wp-content/themes/pub/wporg-learn-2024/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ function add_site_navigation_menus( $menus ) {
'className' => 'has-separator',
),
);
if ( ! is_user_logged_in() ) {
global $wp;
$redirect_url = home_url( $wp->request );
$menu[] = array(
'label' => __( 'Log in', 'wporg-learn' ),
'url' => wp_login_url( $redirect_url ),
);
}

$learning_pathways = get_terms(
array(
Expand Down

0 comments on commit 4031ca9

Please sign in to comment.