Skip to content

Commit

Permalink
2024 Theme: add My Courses to local nav
Browse files Browse the repository at this point in the history
Temporary styling solution until we add support for a secondary section in the mu-plugins local navigation block.

Closes #2481
  • Loading branch information
adamwoodnz committed May 31, 2024
1 parent bfb44be commit e74485b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wp-content/themes/pub/wporg-learn-2024/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace WordPressdotorg\Theme\Learn_2024;

use function WPOrg_Learn\Sensei\{get_my_courses_page_url};

// Block files
require_once __DIR__ . '/src/learning-pathway-cards/block.php';
require_once __DIR__ . '/src/upcoming-online-workshops/block.php';
Expand Down Expand Up @@ -106,6 +108,10 @@ function add_site_navigation_menus( $menus ) {
'label' => __( 'Online Workshops', 'wporg-learn' ),
'url' => '/online-workshops/',
),
array(
'label' => __( 'My courses', 'wporg-learn' ),
'url' => get_my_courses_page_url(),
),
);

$learning_pathways = get_terms(
Expand Down
15 changes: 15 additions & 0 deletions wp-content/themes/pub/wporg-learn-2024/src/style/_local-nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.wp-block-wporg-local-navigation-bar {
&:not(.wporg-show-collapsed-nav) {
[href*="my-courses"] {
padding-left: var(--wp--style--block-gap);

&::before {
content: "\2022";
inset-inline-start: -5px;
opacity: 0.4;
position: absolute;
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

@import "card";
@import "course-grid";
@import "local-nav";
@import "sensei";
@import "tag";
@import "wp-components";
Expand Down

0 comments on commit e74485b

Please sign in to comment.