Skip to content

Instantly share code, notes, and snippets.

Avatar
🍗
I'm Hungry

Thomas Patrick Levy thomasplevy

🍗
I'm Hungry
View GitHub Profile
@thomasplevy
thomasplevy / llms-mc-apikey-constant.php
Created Feb 24, 2021
Define the MailChimp API key as a constant instead of saving to your site's database (LifterLMS MailChimp)
View llms-mc-apikey-constant.php
<?php // Don't copy this line to your wp-config.php file!
// MailChimp
define( 'LLMS_MAILCHIMP_API_KEY', 'YOUR-API-KEY-GOES-HERE' );
@thomasplevy
thomasplevy / llms-auth-dot-net-api-cred-constants.php
Last active Jan 25, 2021
Store Authorize.Net API Credentials as constants (in a wp-config.php file, for example) instead of saving them to the WP database (LifterLMS Authorize.Net)
View llms-auth-dot-net-api-cred-constants.php
<?php // don't copy this line to your wp-config.php file!
// Sandbox (Test) API Credentails.
define( 'LLMS_AUTH_DOT_NET_TEST_CLIENT_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' );
define( 'LLMS_AUTH_DOT_NET_TEST_LOGIN_ID', 'XXXXXXXXX' );
define( 'LLMS_AUTH_DOT_NET_TEST_TRANSACTION_KEY', 'XXXXXXXXXXXX' );
// Production (Live) API Credentails.
define( 'LLMS_AUTH_DOT_NET_LIVE_CLIENT_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' );
define( 'LLMS_AUTH_DOT_NET_LIVE_LOGIN_ID', 'XXXXXXXXX' );
@thomasplevy
thomasplevy / llms_mc_enable_consent.php
Created Oct 14, 2020
Disable user consent/opt-in to MailChimp lists during LifterLMS user registration
View llms_mc_enable_consent.php
@thomasplevy
thomasplevy / llms-tz-to-drip-restriction-message.php
Created Aug 21, 2020
Add a timezone to a lesson drip restriction message in LifterLMS
View llms-tz-to-drip-restriction-message.php
<?php // Do not copy this line to a functions.php file!
/**
* Add a timezone string to the end of the lesson drip availability message
*
* The default message is: "The lesson "{$LESSON_TITLE}" will be available on {$AVAILABLE_DATE}
*
* This filter converts the message to: "The lesson "{$LESSON_TITLE}" will be available on {$AVAILABLE_DATE} {$TIMEZONE}
*
* @since 2020-08-21
@thomasplevy
thomasplevy / llms-bp-private-network-compat.php
Created Jul 15, 2020
Make the BuddyPress/BuddyBoss "Private Network" available only to "active" LifterLMS User Accounts
View llms-bp-private-network-compat.php
<?php // don't copy this to a functions.php file!
/**
* Make the BuddyPress/BuddyBoss "Private Network" available only to "active" LifterLMS User Accounts
*
* An "active" account is any logged in user with active enrollment into at least one course or membership.
*
* @return void
*/
function bp_llms_private_network_redirect() {
View libinput-gestures.conf
# Show Activities
gesture swipe up 4 xdotool key super
# Show Applications
gesture swipe down 4 xdotool key super+a
# Navigation: Forward & Back
gesture swipe left 3 xdotool key alt+Right
gesture swipe right 3 xdotool key alt+Left
@thomasplevy
thomasplevy / llms-stripe-dequeue.php
Created Jun 3, 2020
Remove Stripe.js (as enqueued by the LifterLMS Stripe plugin) from pages where Stripe isn't explicitly required or used
View llms-stripe-dequeue.php
<?php // Don't copy this line to your functions.php file!
/**
* Remove Stripe.js (as enqueued by the LifterLMS Stripe plugin) from pages where Stripe isn't explicitly required or used.
*
* Stripe *recommends* that you load Stripe.js on every site on your website
* to improve automatic fraud detection (https://stripe.com/docs/radar).
*
* You can use this code if you don't care about Radar / fraud detection
* to enjoy a small performance improvement.
View llms-twilio-api-cred-constants.php
<?php // don't copy this line to your wp-config.php file!
// Twilio.
define( 'LLMS_TWILIO_SID', 'XXXXXXXXXXXXXXXXXXXXXXXXXX' );
define( 'LLMS_TWILIO_AUTHKEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXX' );
@thomasplevy
thomasplevy / llms-stripe-js-locale.php
Created Apr 7, 2020
Adjust the language of the LifterLMS Stripe Credit Card Form.
View llms-stripe-js-locale.php
<?php // don't copy this line to your functions.php file!
/**
* Adjust the locale of the Stripe.js credit card form.
*
* @param array $settings Array of settings.
* @return array
*/
function my_llms_stripe_js_locale( $settings ) {
@thomasplevy
thomasplevy / llms_before_checkout_validation-email-blacklist.php
Last active May 11, 2020
Create an email blacklist to prevent spam checkouts when using LifterLMS
View llms_before_checkout_validation-email-blacklist.php
<?php // Don't copy this line to your functions.php file.
/**
* Create an email blacklist to prevent spam registrations during LifterLMS checkout
*
* This is hooked to llms_before_checkout_validation
*
* This filter runs prior to any built-in checkout form validations allowing custom
* validations to be run.
*