Skip to content

Instantly share code, notes, and snippets.

View actual-saurabh's full-sized avatar
💭
I may be slow to respond.

Saurabh Shukla actual-saurabh

💭
I may be slow to respond.
View GitHub Profile
@actual-saurabh
actual-saurabh / recipe.json
Created July 5, 2018 09:01
Micros Recipe
{
"name": "llms/dummy-recipe",
"description": "This Recipe creates enrolls & redirects newly registered members to a welcome course.",
"author": "saurabhshukla",
"tags": [ "onboarding", "membership", "course" ],
"micros": [ "llms/welcome-course-membership", "llms/dummy-micro" ]
}
@actual-saurabh
actual-saurabh / llms-mailchimp-remove-consent.php
Last active September 2, 2018 13:39
Remove LifterLMS Mailchimp Consent Feature
@actual-saurabh
actual-saurabh / lifterlms-custom-profile-fields-add.php
Last active March 30, 2020 19:05 — forked from thomasplevy/lifterlms-custom-profile-fields-add.php
Custom Fields added to LifterLMS Registration/Checkout
<?php // don't copy this line to your functions.php file
/**
*
* Create Company Industry as a custom field upon registration or checkout
*
* @param $fields - fields already being registered
* @param $screen - either checkout or registration screen
* @return $fields - array with added field
*/
function add_company_industry_lifterlms ( $fields , $screen ) {
@actual-saurabh
actual-saurabh / llms-addon-course-emrollment.php
Last active July 10, 2018 14:56
Addon Course Enrollment
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_action( 'llms_user_enrolled_in_course', 'llms_enroll_in_addon_course', 10, 2 );
function llms_enroll_in_addon_course( $student_id, $course_id ){
/*
* the main course's id.
@actual-saurabh
actual-saurabh / Session.php
Last active October 19, 2018 11:54
Generate Client IDs
<?php
/*
* Call like
* Session->start( $unique );
*/
class Session{
// hook into WordPress to start sessions.
@actual-saurabh
actual-saurabh / llms-one-time-payment-trial.php
Last active July 23, 2018 17:15
Create a trial on a one time payment access plan
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_filter( 'llms_get_product_schedule_details', 'llms_one_time_payment_trial', 10, 2 );
function llms_one_time_payment_trial( $schedule_message, $access_plan ) {
/* get access plan id from next to the Access Plan's Title, for eg:
* "Test Access (ID# 1322)"
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_filter( 'llms_get_student_dashboard_tabs' , 'llms_remove_dashboard_index' );
function llms_remove_dashboard_index( $endpoints ){
$endpoints['dashboard']['content'] = $endpoints['view-courses']['content'];
$endpoints['dashboard']['title'] = $endpoints['view-courses']['title'];
@actual-saurabh
actual-saurabh / git-style-guide.md
Last active July 27, 2018 13:54
Git Style Guide

Table of Contents

  • Introduction
  • Branches
  • Commits
  • Messages
  • Pull Requests
  • References

References

@actual-saurabh
actual-saurabh / llms-course-continue-redirect.php
Created August 23, 2018 15:02
LifterLMS Course redirect to first incomplete lesson
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_action( 'template_redirect', 'lifterlms_course_continue_redirect' );
if ( ! function_exists( 'lifterlms_course_continue_redirect' ) ) {
function lifterlms_course_continue_redirect( $post_id = null, $student = null, $progress = null ) {
@actual-saurabh
actual-saurabh / custom-empty-cart-messages.php
Created October 2, 2018 15:55
Display custom messages and links for empty cart on checkout pages
<?php// Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_filter( 'lifterlms_pre_checkout_error', 'llms_custom_empty_cart_message' );
function llms_custom_empty_cart_message(){
if ( isset( $_GET['plan'] ) && is_numeric( $_GET['plan'] ) ) {
return false;