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
  • 04:13 (UTC -07:00)
View GitHub Profile
@thomasplevy
thomasplevy / lifterlms.php
Last active February 17, 2016 02:13
patch test for lifterlms puc conflict
<?php
/**
* Plugin Name: LifterLMS
* Plugin URI: https://lifterlms.com/
* Description: LifterLMS, the #1 WordPress LMS solution, makes it easy to create, sell, and protect engaging online courses.
* Version: 2.0.4
* Author: Mark Nelson, Thomas Patrick Levy, codeBOX, LLC
* Author URI: http://gocodebox.com
* Text Domain: lifterlms
* Domain Path: /languages
@thomasplevy
thomasplevy / gist:d1f7b51c3b37ba201fc5
Created March 4, 2016 22:57
lint all php files in directory
find . -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
<?php
// add an action to the hook
add_action( 'lifterlms_register_form', 'my_custom_lifterlms_registration_fields' );
// create the function that add_action will call
// this function should echo or output html
// the HTML below follows the format of the other fields LifterLMS outputs by default
function my_custom_lifterlms_registration_fields() {
?>
<?php
// add an action to the hook
add_action( 'lifterlms_user_registered', 'save_my_custom_lifterlms_registration_fields', 10, 1 );
// create the function that add_action will call
// $user_id is going to be the WP User ID of the newly created user
function save_my_custom_lifterlms_registration_fields( $user_id ) {
// look at $_POST to find the fields you've created in the previous function
@thomasplevy
thomasplevy / llms.functions.access.php
Created March 8, 2016 22:43
lifterlms patch file
<?php
/**
* Page functions
*
* Functions used for managing page / post access
*
* @author codeBOX
* @project lifterLMS
*/
<?php // don't include this line when copying
/**
* Add custom validation to the LifterLMS Registration Form
* @param obj $errors instance of WP_Error
* @return obj
*/
function my_lifterlms_registration_validation( $errors ) {
// if the phone number field is not submitted or is empty
@thomasplevy
thomasplevy / class.llms.shortcodes.php
Created March 10, 2016 19:48
patch file for llms cust
<?php
/**
* Shortcode base class
*
* Shortcode logic
*
* @version 1.0
* @author codeBOX
* @project lifterLMS
.llms-progress-circle-count { top: 38%; }
.llms-quiz-result-details { margin-top: 25px; }
.llms-quiz-result-details ul { list-style-type: none !important; }
@thomasplevy
thomasplevy / llms-default-country.php
Created March 23, 2016 20:31
Change the default country on LifterLMS Country Dropdowns
<?php // don't copy this line into your functions.php file
// make Great Britain the default country in the country list on LifterLMS Country Selects
add_filter( 'lifterlms_countries', function( $countries ) {
$countires = array_merge( array( 'GB' => $counties['GB'] ) , $countries );
return $countires;
} );
<?php // don't include this line when copying!
define( 'LLMS_LOAD_DEPRECATED', false );