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

Add filter for participant profile URL #36

Merged
merged 2 commits into from Mar 20, 2019

Conversation

Projects
None yet
3 participants
@alexsanford
Copy link
Contributor

commented Mar 19, 2019

Fixes #20

Testing Instructions

  • Add the Course Participants widget to the sidebar.
  • Enable public learner profiles. Ensure that the widget links to the profiles.
  • Add the following code snippet, and ensure the widget links instead to http://example.com/learner/<learner-id>:
add_filter( 'sensei_course_participants_profile_url', function( $profile_url, $learner ) {
	return 'http://example.com/learner/' . $learner->ID;
}, 10, 2 );
  • Change the code snippet to the following, and ensure that the widget no longer links anywhere:
add_filter( 'sensei_course_participants_profile_url', function( $profile_url, $learner ) {
	return false;
}, 10, 2 );

@alexsanford alexsanford added this to the 2.0.0 milestone Mar 19, 2019

@alexsanford alexsanford self-assigned this Mar 19, 2019

@alexsanford alexsanford requested review from jom and donnapep Mar 19, 2019

@jom

jom approved these changes Mar 20, 2019

Copy link
Contributor

left a comment

Looks good and works well! Just one wee documentation fix.

Show resolved Hide resolved includes/class-sensei-course-participants-widget.php Outdated

@alexsanford alexsanford merged commit ad59f0e into master Mar 20, 2019

@alexsanford alexsanford deleted the add/filter-for-participant-profile-url branch Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.