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

Conversation

anekola
Copy link

@anekola anekola commented Feb 27, 2021

Fixes #4019

Changes proposed in this Pull Request

  • Add a new filter - sensei_start_course_form_text

Testing instructions

  • "Take This Course" button should work as normal, but developers should be able to modify this with new filter.

New/Updated Hooks

  • New filter: sensei_start_course_form_text

@anekola
Copy link
Author

anekola commented Feb 27, 2021

First pull request, so I tried to make it simple – please let me know if I can improve anything!

@@ -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?

@donnapep
Copy link
Collaborator

donnapep commented Mar 2, 2021

@anekola Thanks for the PR. There's a PHP linting error that will need to be addressed before this PR can be merged.

Also, I wanted to let you know that when you create a new course now, it will use blocks. There is actually a Take Course block that enables customizing the button text right in the editor. Thought I'd mention it in case you'd like to give blocks a try instead.

@donnapep donnapep added the [Status] Needs Author Reply Requires response from the author label Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Author Reply Requires response from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Take This Course" button text is not filterable
2 participants