Skip to content

Instantly share code, notes, and snippets.

Avatar

John Sundberg bhwebworks

View GitHub Profile
@bhwebworks
bhwebworks / gist:9559948
Created Mar 15, 2014
Code to remove from Sixteen Nine Pro functions.php to remove the avatar image from the site header
View gist:9559948
//* 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 Aug 29, 2015
Add headers to LearnDash ProPanel dashboard messages
View gist:e3e76f5a35ac71cabbad
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))
View gist:eb08eedda250f15fdbc6
<?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 Nov 27, 2014
Attempt to force IE to use most recent rendering engine available
View 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() {
View wpmail_exceptions.php
<?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 Aug 29, 2015
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
View modified - 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 Aug 29, 2015
Exclude Sensei lessons and courses from search results
View Exclude 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 Jan 28, 2012
Contact Form original lines of code (78-85)
View gist:1692058
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 Jan 28, 2012
Contact form Invalid Token patch
View gist:1692086
if ($user->get('id') || ($viewnow == 'category' && $viewcache == 0)) {
$view->display();
} else {
+
+ // Workaround for token caching
+ if ($viewName == 'contact')
+ {
+ ob_start();
+ }
+
@bhwebworks
bhwebworks / gist:1696074
Created Jan 28, 2012
Default code in error.php
View gist:1696074
defined( '_JEXEC' ) or die( 'Restricted access' );
?>