Skip to content

Commit

Permalink
Unify messages
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed Oct 30, 2023
1 parent 3341ba8 commit 5349118
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions includes/class-sensei-lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -4782,17 +4782,13 @@ public static function course_signup_link() {
$course_link .= esc_html__( 'course', 'sensei-lms' );
$course_link .= '</a>';

$format = '';
// translators: The placeholder %1$s is a link to the Course.
$message_default = sprintf( esc_html__( 'Please sign up for the %1$s before starting the lesson.', 'sensei-lms' ), $course_link );

if ( Sensei_Course::is_self_enrollment_not_allowed( $course_id ) ) {
// translators: The placeholder %1$s is a link to the Course.
$format = esc_html__( 'Please contact the course administrator to sign up for the %1$s before starting the lesson.', 'sensei-lms' );
} else {
// translators: The placeholder %1$s is a link to the Course.
$format = esc_html__( 'Please sign up for the %1$s before starting the lesson.', 'sensei-lms' );
$message_default = esc_html__( 'Please contact the course administrator to access the course content.', 'sensei-lms' );
}

$message_default = sprintf( $format, $course_link );

/**
* Filter the course sign up notice message on the lesson page.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-tests/test-class-lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ public function testCourseSignupLink_WhenSignupNoticeNeededAndCourseDoesntAllowS
/* Expect & Act */
$notices->expects( self::once() )
->method( 'add_notice' )
->with( $this->stringContains( 'Please contact the course administrator to sign up for' ) );
->with( 'Please contact the course administrator to access the course content.' );
$result = Sensei_Lesson::course_signup_link();
}

Expand Down

0 comments on commit 5349118

Please sign in to comment.