Skip to content

Instantly share code, notes, and snippets.

Avatar

Joel Worsham joelworsham

View GitHub Profile
@joelworsham
joelworsham / ld-gb-user-grade.php
Created Aug 14, 2018
LearnDash Gradebook User Grade @ 1.3.6
View ld-gb-user-grade.php
<?php
/**
* Contains the grade for a given user.
*
* @since 1.0.0
*
* @package LearnDash_Gradebook
* @subpackage LearnDash_Gradebook/includes
*/
@joelworsham
joelworsham / gf-plugin-part.php
Created Aug 3, 2018
GF Plugin Exporting Spam
View gf-plugin-part.php
<?php
/**
* Class Lowry_GF_Exporting
*
* Customizes exporting entries. Specifically to include spam entries.
*
* @since {{VERSION}}
*/
// Exit if accessed directly
View wpproquiz-email-results.php
<?php
/**
* Modifies WP Pro Quiz so I can get the dang answers in the results.
*
* @since 0.1.0
* @package ME10
*/
// Don't load directly
if ( ! defined( 'ABSPATH' ) ) {
View foundation-settings.scss
// Foundation for Sites Settings
// -----------------------------
//
// Table of Contents:
//
// 1. Global
// 2. Breakpoints
// 3. The Grid
// 4. Base Typography
// 5. Typography Helpers
@joelworsham
joelworsham / ld-gb-reorder-grades-filtercomponents.php
Created Oct 18, 2016
LearnDash Gradebook re-order grades example 2
View ld-gb-reorder-grades-filtercomponents.php
<?php
function my_modify_gradebook_type_components( $components ) {
if ( ! $components ) {
return $components;
}
foreach ( $components as $type_id => &$component ) {
@joelworsham
joelworsham / ld-gb-reorder-grades-pregetposts.php
Created Oct 18, 2016
LearnDash Gradebook re-order grades example
View ld-gb-reorder-grades-pregetposts.php
<?php
function my_modify_gradebook_type_posts( $wp_query ) {
// Make sure it's the proper query
if ( $wp_query->is_main_query() ||
$wp_query->get('post_type') != array( 'sfwd-assignment', 'sfwd-quiz' ) ||
! $wp_query->get('tax_query')
) {
return;
View joel_extend_api.php
<?php
add_filter( 'wlmapi_the_members', function ( $members ) {
if ( $members && isset( $members['members'] ) && isset( $members['members']['member'] ) ) {
foreach ( $members['members']['member'] as &$member ) {
$member['agent_ambassadors'] = get_user_meta( $member['id'], 'agent_ambassadors', true );
$member['lender_ambassadors'] = get_user_meta( $member['id'], 'lender_ambassadors', true );
$member['agent_ambassador_default'] = get_user_meta( $member['id'], 'agent_ambassador_default', true );
View custom-roles.php
<?php
/**
* Plugin Name: DZS Roles
* Description: Provides custom roles for the Detroit Zoo website.
* Author: Joel Worsham
* Author URI: http://realbigmarketing.com
* Version: 1.0.1
*/
if ( ! defined( 'ABSPATH' ) ) {
@joelworsham
joelworsham / wp-gruntfile-4.2.0.js
Last active Aug 29, 2015
The WordPress Gruntfile
View wp-gruntfile-4.2.0.js
/* jshint node:true */
module.exports = function(grunt) {
var path = require('path'),
SOURCE_DIR = 'src/',
BUILD_DIR = 'build/',
mediaConfig = {},
mediaBuilds = ['audiovideo', 'grid', 'models', 'views'];
// Load tasks.
require('matchdep').filterDev(['grunt-*', '!grunt-legacy-util']).forEach( grunt.loadNpmTasks );
View gist:ca39eeacace703c368a4
<?php
...
if ( version_compare( '5.3', phpversion(), '>' ) ) {
add_action( 'admin_notices', '_myplugin_php_notice' );
// Do what you need to stop your plugin from loading
}
/**
* Displays an admin error about needing to update the server's PHP version.