Skip to content

Instantly share code, notes, and snippets.

View bhwebworks's full-sized avatar

John Sundberg bhwebworks

View GitHub Profile
@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' );
@bhwebworks
bhwebworks / stream-filter-v1.php
Last active October 22, 2019 12:05
Prevent unwanted results from appearing in (future) Stream records
<?php
// Prevent unwanted results from appearing in (future) Stream records - v 1.x
add_filter( 'wp_stream_record_array', 'bhww_core_wp_stream_filter_record_array', 10, 1 );
function bhww_core_wp_stream_filter_record_array( $recordarr ) {
// BackupBuddy (iThemes) entries
$context = 'settings';
$option = 'ithemes-updater-cache';
@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',
) );
<?php
add_action( 'tgmsp_before_slider_output', 'tgm_custom_slider_theme' );
function tgm_custom_slider_of_madness( $id ) {
// If not the proper slider ID, do nothing. Change to match your slider ID.
if ( '324' !== $id ) return;
// Dequeue the default styles.
wp_dequeue_style( 'soliloquy-style' );
/**
* Filter Event Organiser to use the timezone set in WordPress settings
*
* Uses a filter hook found in includes/class-eo-ical-parser.php
*
* @link http://blackhillswebworks.com/?p=5108
*/
add_filter( 'eventorganiser_ical_timezone', 'bhww_eo_set_timezone' );
<FilesMatch "\.(?i:pdf|doc|docx|jpg|xls|zip|txt)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
/**
* Redirect WordPress front end https URLs to http without a plugin
*
* Necessary when running forced SSL in admin and you don't want links to the front end to remain https.
*
* @link http://blackhillswebworks.com/?p=5088
*/
add_action( 'template_redirect', 'bhww_ssl_template_redirect', 1 );