Skip to content

Instantly share code, notes, and snippets.

View bhwebworks's full-sized avatar

John Sundberg bhwebworks

View GitHub Profile
@bhwebworks
bhwebworks / gist:9559948
Created March 15, 2014 00:32
Code to remove from Sixteen Nine Pro functions.php to remove the avatar image from the site header
//* Add support for custom header
add_theme_support( 'custom-header', array(
'admin-preview-callback' => 'sixteen_nine_admin_header_callback',
'default-text-color' => 'ffffff',
'header-selector' => '.site-header .site-avatar img',
'height' => 224,
'width' => 224,
'wp-head-callback' => '__return_false',
) );
@bhwebworks
bhwebworks / gist:e3e76f5a35ac71cabbad
Last active August 29, 2015 14:09
Add headers to LearnDash ProPanel dashboard messages
static function send_dashboard_emails($course_progress_data = null) {
if(empty($_POST["submit_propanel_email"]) || empty($_POST["course_id"]) || empty($_POST[ "learndash_propanel_message"]) || empty($_POST[ "learndash_propanel_subject"]) )
return;
$course_id = $_POST["course_id"];
if(is_null($course_progress_data))
$course_progress_data = SFWD_LMS::course_progress_data($course_id);
if(empty($course_progress_data))
<?php
add_filter( 'wp_stream_record_array', 'bhww_filter_wp_stream_record_array', 10, 1 );
function bhww_filter_wp_stream_record_array( $recordarr ) {
if ( ! isset( $recordarr[0] ) )
return array();
// BackupBuddy (iThemes) entries
if ( 'settings' === $recordarr[0]['connector'] && isset( $recordarr[0]['stream_meta']['option'] ) && 'ithemes-updater-cache' === $recordarr[0]['stream_meta']['option']
@bhwebworks
bhwebworks / Attempt to force IE to use most recent rendering engine available
Created November 27, 2014 03:55
Attempt to force IE to use most recent rendering engine available
/**
* Attempt to force IE to use most recent rendering engine available
*
* @link http://blackhillswebworks.com/?p=5578
* @link https://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible
*/
add_action( 'genesis_meta', 'bhww_head_meta_ie_compatibility_mode_fix' );
function bhww_head_meta_ie_compatibility_mode_fix() {
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) PHPMailer Exceptions & SMTP
* Description: WordPress by default returns <code>FALSE</code> instead of an <code>Exception</code>. This plugin fixes that.
*/
add_action( 'phpmailer_init', 'WCMphpmailerException' );
function WCMphpmailerException( $phpmailer )
{
@bhwebworks
bhwebworks / modified - class-woothemes-sensei-course.php
Last active August 29, 2015 14:12
Add an "Add another lesson to this course" link to Sensei Edit Course admin page by modifying the course_lessons_meta_box_content function. Found in classes/class-woothemes-sensei-course.php
<?php
/**
* course_lessons_meta_box_content function.
*
* @access public
* @return void
*/
public function course_lessons_meta_box_content () {
global $post;
@bhwebworks
bhwebworks / Exclude from search results
Last active August 29, 2015 14:15
Exclude Sensei lessons and courses from search results
<?php
// use the code below this comment
add_action( 'init', 'update_my_custom_type', 99 );
/**
* update_my_custom_type
*
* @author Joe Sexton <joe@webtipblog.com>
*/
@bhwebworks
bhwebworks / gist:1692058
Created January 28, 2012 01:53
Contact Form original lines of code (78-85)
if ($user->get('id') || ($viewnow == 'category' && $viewcache == 0)) {
$view->display();
} else {
$option = JRequest::getCmd('option');
$cache =& JFactory::getCache($option, 'view');
$cache->get($view, 'display');
}
}
@bhwebworks
bhwebworks / gist:1692086
Created January 28, 2012 02:01
Contact form Invalid Token patch
if ($user->get('id') || ($viewnow == 'category' && $viewcache == 0)) {
$view->display();
} else {
+
+ // Workaround for token caching
+ if ($viewName == 'contact')
+ {
+ ob_start();
+ }
+
@bhwebworks
bhwebworks / gist:1695981
Created January 28, 2012 22:22
Standard copyright information
&copy; Copyright 2009, [Your Company Name]. All rights reserved