Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sensei_start_course_form() text filterable #4020

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion includes/template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ function sensei_start_course_form( $course_id ) {
if ( $prerequisite_complete ) {
wp_enqueue_script( 'sensei-stop-double-submission' );

$sensei_start_course_form_text = apply_filters( 'sensei_start_course_form_text', esc_html( 'Take This Course', 'sensei-lms' ) );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider calling this filter something else to more accurately describe what it filters. What about sensei_take_course_button_text?


?><form method="POST" action="<?php echo esc_url( get_permalink( $course_id ) ); ?>">

<input type="hidden" name="<?php echo esc_attr( 'woothemes_sensei_start_course_noonce' ); ?>" id="<?php echo esc_attr( 'woothemes_sensei_start_course_noonce' ); ?>" value="<?php echo esc_attr( wp_create_nonce( 'woothemes_sensei_start_course_noonce' ) ); ?>" />

<span><input name="course_start" type="submit" class="course-start sensei-stop-double-submission" value="<?php esc_html_e( 'Take This Course', 'sensei-lms' ); ?>"/></span>
<span><input name="course_start" type="submit" class="course-start sensei-stop-double-submission" value="<?php echo esc_attr( $sensei_start_course_form_text ); ?>"/></span>

</form>
<?php
Expand Down