Skip to content

Instantly share code, notes, and snippets.

View thomasplevy's full-sized avatar
🍗
I'm Hungry

Thomas Patrick Levy thomasplevy

🍗
I'm Hungry
  • Moose Town Media Business Company
  • Phoenix, AZ
  • 02:51 (UTC -07:00)
View GitHub Profile
<?php // Don't copy this line to your wp-config.php file!
// Live API Credentials.
define( 'LLMS_PAYPAL_LIVE_API_USERNAME', 'some-facilitator_api1.mysite.com' );
define( 'LLMS_PAYPAL_LIVE_API_PASSWORD', '****************' );
define( 'LLMS_PAYPAL_LIVE_API_SIGNATURE', '***************************-****************************' );
// Sandbox API Credentials.
define( 'LLMS_PAYPAL_TEST_API_USERNAME', 'some-facilitator_api1.mysite.com' );
define( 'LLMS_PAYPAL_TEST_API_PASSWORD', '****************' );
@thomasplevy
thomasplevy / lifterlms-pdfs-pdflayer-secure-api-access-key.php
Last active November 27, 2019 19:03
Define LifterLMS PDFs pdflayer API Access Key in a wp-config.php file instead of in your site's WPDB.
<?php // don't copy this line to your wp-config.php file!
// pdflayer API Access Key.
define( 'LLMS_PDFS_PDFLAYER_ACCESS_KEY', '****' ); // Replace **** with your API Access Key.
<?php // don't copy this line to the functions.php file!
/**
* Modify the course catalog description
*/
function my_alter_llms_post_type_course_description( $course_data ) {
// remvoe the description.
unset( $course_data[ 'description' ] );
@thomasplevy
thomasplevy / llms-rest-disable.php
Created August 16, 2019 16:30
Disable the LifterLMS REST API
<?php // do not copy this line to your wp-config.php file
// The following line disables the LifterLMS REST API.
define( 'LLMS_REST_DISABLE', true );
@thomasplevy
thomasplevy / llms-tracking.js
Created May 9, 2019 19:55
WIP: JS Local Storage user interaction/event tracking for LifterLMS
/**
* Store information in Local Storage by group.
*
* @since [version]
*
* @param string group Storage group id/name.
*/
var Storage = function( group ) {
var store = window.localStorage;
@thomasplevy
thomasplevy / llms_hide_content.txt
Last active May 1, 2019 17:39
[lifterlms_hide_content] shortcode examples
[lifterlms_hide_content id="1"]
This will only display to a user with access to the post with an ID of 1.
[/lifterlms_hide_content]
[lifterlms_hide_content id="1,2,3,4" relation="any"]
This will be displayed only to a user with access to at least one of the posts in the list: 1, 2, 3, or 4.
[/lifterlms_hide_content]
@thomasplevy
thomasplevy / llms-stripe-api-key-constants.php
Created April 17, 2019 23:07
Define Stripe API keys as constants instead of saving them to your sites database (LifterLMS Stripe)
<?php // don't copy this line to your functions.php file!
// Live API Keys.
define( 'LLMS_STRIPE_LIVE_PUBLISHABLE_KEY', 'pk_live_**************' );
define( 'LLMS_STRIPE_LIVE_SECRET_KEY', 'sk_live_**************' );
// Test API Keys.
define( 'LLMS_STRIPE_TEST_PUBLISHABLE_KEY', 'pk_test_**************' );
define( 'LLMS_STRIPE_TEST_SECRET_KEY', 'sk_test_**************' );
@thomasplevy
thomasplevy / llms_pa_post_access.php
Created April 3, 2019 18:36
Modify the default capability required to access LifterLMS Private Posts and Automations
<?php // don't copy this line to the functions.php file!
/**
* Modify the default capability required to access LifterLMS Private Posts and Automations
*
* @param string $cap Default capability (manage_options)
* @return string
*/
function my_custom_pa_cap( $cap ) {
return 'manage_lifterlms';
@thomasplevy
thomasplevy / llms_ck_enable_consent.php
Created March 18, 2019 21:11
Disable "consent" in LifterLMS ConvertKit
@thomasplevy
thomasplevy / llms-left-side-notifications.css
Created March 5, 2019 20:54
move LifterLMS popover notifications to the left-hand side of the screen
@media all and (min-width: 480px) {
.llms-notification {
right: auto;
left: -800px;
}
.llms-notification.visible {
left: 24px;
right: auto;
}
}