Skip to content

Instantly share code, notes, and snippets.

Saurabh Shukla actual-saurabh

  • India
Block or report user

Report or block actual-saurabh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@actual-saurabh
actual-saurabh / class-llms-serial-number-generator.php
Last active Feb 10, 2020
Serial Numbers for Transaction Receipts
View class-llms-serial-number-generator.php
<?php // Do not copy this line
// copy from below this line
/**
* Generates sequential serial numbers for a given post type
*/
class LLMS_Serial_Number_Generator {
private $post_type = '';
View llms-access-plan-switch-filters.php
<?php
// hide system access plans from pricing table and course/membership editor
add_filter( 'llms_get_product_access_plans_args', 'llms_custom_hide_system_access_plans_args' );
function llms_custom_hide_system_access_plans_args ( $args, $product, $free_only, $visible_only ) {
if( isset( $args['tax_query'] ) ) {
$args['tax_query'][0]['terms'][] = 'system';
View class-llms-nav-actions.php
<?php
/**
* Contains Navigation Action Class
*/
defined( 'ABSPATH' ) || exit;
/**
* Class for calculating navigation actions
*/
@actual-saurabh
actual-saurabh / llms-certificate-grade-merge-code.php
Created Oct 5, 2019
LifterLMS Certificate Merge Code for Grades
View llms-certificate-grade-merge-code.php
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_filter( 'llms_certificate_merge_codes', 'llms_certificate_grade_merge_code', 10, 2 );
function llms_certificate_grade_merge_code( $merge_codes_array, $certificate_object ) {
// add custom certificate title merge code to existing ones. See https://github.com/gocodebox/lifterlms/blob/a1a6833c6e6bab57bf4356739463220e51f89408/includes/certificates/class.llms.certificate.user.php#L132
@actual-saurabh
actual-saurabh / restrospective-certificates.php
Created Sep 24, 2019
Award a Certificate associated with a trigger and an engagement to a user
View restrospective-certificates.php
<?php
/**
* Award a certificate engagement attached to a unit (course, quiz, etc) to a user
* @param int $user_id The ID of the user to award the certificate to.
* @param int $engagement_id The post ID of the engagement
* @param int $trigger_id The post ID of the trigger post (course, lesson, quiz, etc)
*/
function llms_award_certificate( $user_id, $engagement_id, $trigger_id ){
@actual-saurabh
actual-saurabh / llms-change-cols-number.php
Created Jul 1, 2019
Change LifterLMS registration field column class (llms-cols-6, etc)
View llms-change-cols-number.php
<?php // Do not copy this line.
// Copy from under this line and paste into your child theme's functions.php.
add_filter( 'lifterlms_get_person_fields', 'llms_change_form_cols', 10, 1 );
function llms_change_form_cols( $fields ) {
foreach ( $fields as $field ) {
if ( $field['id'] === 'llms_billing_city' ){
@actual-saurabh
actual-saurabh / llms-email-unit-redirection.php
Last active May 13, 2019
LifterLMS redirect users to login and back from email links of restricted content
View llms-email-unit-redirection.php
<?php
/*
* Any links to restricted pages added to emails should contain a redirection parameter.
* When user lands on a restricted screen with a redirection parameter,
* they are redirected to the login screen (with the usual notice).
* On loggin in, the user is redirected back to the restricted page.
*/
add_action( 'lifterlms_content_restricted', 'llms_maybe_email_unit_redirect', 10, 1);
@actual-saurabh
actual-saurabh / llms-focus-mode.css
Last active May 13, 2019
LifterLMS Distraction Free Fullscreen mode
View llms-focus-mode.css
body.llms-is-focused .content-area {
background: #fff none;
padding:0;
overflow-y:scroll;
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
bottom:0;
@actual-saurabh
actual-saurabh / llms-certificate-custom-merge-codes.php
Created Apr 2, 2019
LifterLMS Custom Merge Codes for Certificates
View llms-certificate-custom-merge-codes.php
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_filter( 'llms_certificate_merge_codes', 'llms_custom_certificate_prefix_suffix_merge_codes', 10, 2 );
function llms_custom_certificate_title_merge_code( $merge_codes_array, $certificate_object ){
// add custom certificate title merge code to existing ones. See https://github.com/gocodebox/lifterlms/blob/a1a6833c6e6bab57bf4356739463220e51f89408/includes/certificates/class.llms.certificate.user.php#L132
$merge_codes_array['{merge-code-1}'] = get_user_meta( $certificate_object->user_id, 'custom_field_key_1', true );
@actual-saurabh
actual-saurabh / llms-sl-remove-stories.php
Last active Mar 26, 2019
LifterLMS Social Learning Remove Stories
View llms-sl-remove-stories.php
<?php //don't copy-paste this line
// copy-paste from under here-->
// complete
remove_action( 'lifterlms_course_completed', array( 'LLMS_SL_Stories', 'complete' ), 25, 2 );
// earn achievement( badges, certificates, etc)
remove_action( 'llms_user_earned_achievement', array( 'LLMS_SL_Stories', 'achievement' ), 25, 3 );
You can’t perform that action at this time.