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:18 (UTC -07:00)
View GitHub Profile
@thomasplevy
thomasplevy / lifterlms-resolve-acfpro-select2-late.php
Last active August 29, 2016 17:48
attempts to resolve various select2 conflicts LifterLMS has with other plugins / themes
<?php // don't include this line if pasting into an existing php file!
// late fire version of above...
/**
* Dequeue the 3.5.x version of Select2 JS library enqueued by ACF Pro
* This is only necessary on LifterLMS Quiz & Course Pages where LifterLMS
* requires version 4.x or higher to correctly function
*/
function maybe_dequeue_select2() {
$screen = get_current_screen();
if ( 'llms_quiz' === $screen->post_type || 'course' === $screen->post_type ) {
<?php // don't include this line when copying!
define( 'LLMS_LOAD_DEPRECATED', false );
@thomasplevy
thomasplevy / lifterlms-remove-genesis-alt-sidebar.php
Last active April 4, 2016 18:01
Remove Genesis Alternate Sidebar from LifterLMS Course Page
<?php // don't include this line when copying!
/**
* Deregister Genesis sidebar(s) on LifterLMS Course page
*/
function maybe_deregister_sidebars() {
if ( 'course' === get_post_type() ) {
remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' );
@thomasplevy
thomasplevy / lifterlms-remove-genesis-alt-sidebar.php
Created April 4, 2016 18:02
Remove the Genesis Secondary Sidebar on LifterLMS Lesson Pages
<?php // don't include this line when copying!
/**
* Deregister Genesis sidebar(s) on LifterLMS Lesson page
*/
function maybe_deregister_sidebars() {
if ( 'lesson' === get_post_type() ) {
remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' );
<?php // don't include this when pasting
add_action( 'wp_print_footer_scripts', 'i_know_this_is_bad' );
function i_know_this_is_bad() {
// lets only load this on lessons where it would be used
if ( 'lesson' === get_post_type() ) {
echo "
<script>
@thomasplevy
thomasplevy / lifterlms-no-access-divi-fix.php
Last active October 4, 2016 00:04
"Fix" LifterLMS No Access Template when Divi is the theme
<?php // don't include this if pasting into a php file
/**
* Add Divi Related HTML to LifterLMS templates that need some extra elements
*
* Tested up to Divi v3.0.9
*/
/**
* Remove default LifterLMS Content Wrappers
*/
// we clear the order session data and don't provide you a great way to regrab it for the next function
// so do this shameful thing...
add_filter( 'lifterlms_order_process_success', function( $order ) {
LLMS()->session->set( 'my_temp_order', $order );
}, 10, 1 );
@thomasplevy
thomasplevy / lifterlms-sidebar-compatibility.php
Created April 15, 2016 02:12
Attain sidebar compatibility with just about any theme when using LifterLMS
<?php // do not paste this line into your functions.php
/**
* Display lesson and course custom sidebars on the appropriate LifterLMS pages
*
* @param array $sidebars_widgets array of registered sidebars
* @return array
*/
function lifterlms_sidebar_compatibility( $sidebars_widgets ) {
// replace the widgets in the primary sidebar with LifterLMS Course sidebar on Course Pages
<?php // do not paste this line into your functions.php
/**
* Display lesson and course custom sidebars on the appropriate LifterLMS pages
*
* @param array $sidebars_widgets array of registered sidebars
* @return array
*/
function lifterlms_sidebar_compatibility( $sidebars_widgets ) {
// replace the widgets in the primary sidebar with LifterLMS Course sidebar on Course Pages
@thomasplevy
thomasplevy / joke.txt
Last active April 22, 2016 01:55
just a joke
what's brown and sticky?
|
|
|
|
|
|
|
|
|