Skip to content

Instantly share code, notes, and snippets.

View bhwebworks's full-sized avatar

John Sundberg bhwebworks

View GitHub Profile
@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 / add to functions.php
Last active January 22, 2016 00:51
Filter the genesis_seo_site_title function to use an image for the logo instead of a background image
<?php
/**
* Filter the genesis_seo_site_title function to use an image for the logo instead of a background image
*
* The genesis_seo_site_title function is located in genesis/lib/structure/header.php
* @link http://blackhillswebworks.com/?p=4144
*
*/
@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;
<?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 / 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
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 / 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
//* Do NOT include the opening php tag
//* Add multiple grid loops to a page template*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
function custom_do_grid_loop() {
$args = array(
@bhwebworks
bhwebworks / Add custom metaboxes to WooCommerce products
Last active May 8, 2023 10:50
Add custom metaboxes to WooCommerce products
/**
* Create Custom Meta Boxes for WooCommerce Product CPT
*
* Using Custom Metaboxes and Fields for WordPress library from
* Andrew Norcross, Jared Atchinson, and Bill Erickson
*
* @link http://blackhillswebworks.com/?p=5453
* @link https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress
*/
@bhwebworks
bhwebworks / Add multiple product tabs to WooCommerce 2.x
Last active May 27, 2016 16:06
Add multiple product tabs to WooCommerce 2.x
/**
* Add "Ingredients" and "Benefits" tabs to WooCommerce products
*
* @link http://blackhillswebworks.com/?p=5453
* @link http://www.sean-barton.co.uk/2013/03/remove-woocommerce-20-reviews-tab
* @link http://www.php.net/manual/en/function.htmlspecialchars-decode.php
*/
add_filter( 'woocommerce_product_tabs', 'bhww_woo_extra_tabs' );