Making WordPress.org

Changeset 11487


Ignore:
Timestamp:
01/29/2022 04:01:13 PM (3 years ago)
Author:
Otto42
Message:

Learn: Correct slug to always be 'course' regardless of the language switcher causing the translation from the Sensei-LMS plugin to be used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/sensei.php

    r11057 r11487  
    1717add_action( 'sensei_before_main_content', __NAMESPACE__ . '\theme_wrapper_start' );
    1818add_action( 'sensei_after_main_content', __NAMESPACE__ . '\theme_wrapper_end' );
     19add_filter( 'sensei_course_slug', __NAMESPACE__ . '\wporg_correct_post_slug' );
     20
     21/**
     22 * Correct the slug in post permalinks to always be "course" regardless of the language chosen for the site.
     23 *
     24 * @param string $slug //unused
     25 *
     26 * @return string Correct slug of "course" for the learn.wordpress.org site.
     27 */
     28function wporg_correct_post_slug( $slug ) {
     29        return 'course';
     30}
    1931
    2032/**
Note: See TracChangeset for help on using the changeset viewer.