Skip to content

Commit

Permalink
2024 Theme: add context to learning pathway 'See all' links for scree…
Browse files Browse the repository at this point in the history
…nreaders

See #2482
  • Loading branch information
adamwoodnz committed Jul 24, 2024
1 parent 64b5d1d commit 34e706f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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 @@ -202,28 +202,34 @@ function get_learning_pathway_level_content( $learning_pathway ) {
'beginner' => array(
'title' => __( 'Beginner WordPress users', 'wporg-learn' ),
'description' => __( 'You’re new to WordPress, or building websites, and want the essentials.', 'wporg-learn' ),
'see_all_aria_label' => 'Beginner WordPress users: See all learning pathways',
),
'intermediate' => array(
'title' => __( 'Intermediate WordPress users', 'wporg-learn' ),
'description' => __( 'You’re comfortable setting up your site and making small changes or you’ve already completed the Beginner course.', 'wporg-learn' ),
'see_all_aria_label' => 'Intermediate WordPress users: See all learning pathways',
),
'advanced' => array(
'title' => __( 'Advanced WordPress users', 'wporg-learn' ),
'description' => __( 'You’re confident using multiple plugins and know how to customize a Block theme, or you’ve already completed the Intermediate course.', 'wporg-learn' ),
'see_all_aria_label' => 'Advanced WordPress users: See all learning pathways',
),
),
'developer' => array(
'beginner' => array(
'title' => __( 'Beginner development concepts', 'wporg-learn' ),
'description' => __( 'You’re new to development or have experience using WordPress’s no-code features and want to do more.', 'wporg-learn' ),
'see_all_aria_label' => 'Beginner development concepts: See all learning pathways',
),
'intermediate' => array(
'title' => __( 'Intermediate development concepts', 'wporg-learn' ),
'description' => __( 'You’re comfortable writing code and want to extend WordPress with your own plugin or theme.', 'wporg-learn' ),
'see_all_aria_label' => 'Intermediate development concepts: See all learning pathways',
),
'advanced' => array(
'title' => __( 'Advanced development concepts', 'wporg-learn' ),
'description' => __( 'You’re confident in the WordPress development environment or have already built your own plugin or theme.', 'wporg-learn' ),
'see_all_aria_label' => 'Advanced development concepts: See all learning pathways',
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
<!-- /wp:paragraph -->

<!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|blueberry-1"}}}},"textColor":"charcoal-4"} -->
<p class="has-charcoal-4-color has-text-color has-link-color"><a href="<?php echo esc_url( $learning_pathway_url . '?wporg_lesson_level=beginner' ); ?>"><?php esc_html_e( 'See all', 'wporg-learn' ); ?></a></p>
<p class="has-charcoal-4-color has-text-color has-link-color">
<a href="<?php echo esc_url( $learning_pathway_url . '?wporg_lesson_level=beginner' ); ?>" aria-label="<?php echo esc_attr( $content['beginner']['see_all_aria_label'] ); ?>"><?php esc_html_e( 'See all', 'wporg-learn' ); ?></a>
</p>
<!-- /wp:paragraph -->

</div>
Expand Down Expand Up @@ -76,7 +78,9 @@
<!-- /wp:paragraph -->

<!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|blueberry-1"}}}},"textColor":"charcoal-4"} -->
<p class="has-charcoal-4-color has-text-color has-link-color"><a href="<?php echo esc_url( $learning_pathway_url . '?wporg_lesson_level=intermediate' ); ?>"><?php esc_html_e( 'See all', 'wporg-learn' ); ?></a></p>
<p class="has-charcoal-4-color has-text-color has-link-color">
<a href="<?php echo esc_url( $learning_pathway_url . '?wporg_lesson_level=intermediate' ); ?>" aria-label="<?php echo esc_attr( $content['intermediate']['see_all_aria_label'] ); ?>"><?php esc_html_e( 'See all', 'wporg-learn' ); ?></a>
</p>
<!-- /wp:paragraph -->

</div>
Expand Down Expand Up @@ -112,7 +116,9 @@
<!-- /wp:paragraph -->

<!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|blueberry-1"}}}},"textColor":"charcoal-4"} -->
<p class="has-charcoal-4-color has-text-color has-link-color"><a href="<?php echo esc_url( $learning_pathway_url . '?wporg_lesson_level=advanced' ); ?>"><?php esc_html_e( 'See all', 'wporg-learn' ); ?></a></p>
<p class="has-charcoal-4-color has-text-color has-link-color">
<a href="<?php echo esc_url( $learning_pathway_url . '?wporg_lesson_level=advanced' ); ?>" aria-label="<?php echo esc_attr( $content['advanced']['see_all_aria_label'] ); ?>"><?php esc_html_e( 'See all', 'wporg-learn' ); ?></a>
</p>
<!-- /wp:paragraph -->

</div>
Expand Down

0 comments on commit 34e706f

Please sign in to comment.