Skip to content

Instantly share code, notes, and snippets.

John Sundberg bhwebworks

Block or report user

Report or block bhwebworks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bhwebworks
bhwebworks / all_fields_extra_options.php
Created Dec 1, 2016
The Gravity Forms {all_fields} merge tag in notifications includes all fields which had data entered, it doesn't include HTML fields, Section Break descriptions, nor does it allow you to omit fields from the notification. By adding the following code to your themes functions.php file you will gain the ability to include HTML fields, and Section …
View all_fields_extra_options.php
/**
* to exclude field from notification add 'exclude[ID]' option to {all_fields} tag
* 'include[ID]' option includes HTML field / Section Break field description / Signature image in notification
* see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options
* example: {all_fields:exclude[2,3]}
* example: {all_fields:include[6]}
* example: {all_fields:include[6],exclude[2,3]}
*/
add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 11, 5 );
function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_value ) {
View remove-quick-edit-options.php
// Execute late to catch 'clone' and 'new draft' (Duplicate Post plugin)
add_filter( 'post_row_actions', 'bhww_core_remove_quick_edit_options', 100, 2 );
add_filter( 'page_row_actions', 'bhww_core_remove_quick_edit_options', 100, 2 );
function bhww_core_remove_quick_edit_options( $actions, $post ) {
if ( current_user_can( 'update_core' ) )
return $actions;
global $post;
@bhwebworks
bhwebworks / Redirect specific WordPress pages or posts to https.php
Last active Dec 12, 2017
Redirect specific WordPress pages or posts to https
View Redirect specific WordPress pages or posts to https.php
/**
* Redirect specific pages or posts to https
*
* This code assumes the page/post ID to make https is 7000.
* You will need to change that ID to match your site.
*
* @link http://blackhillswebworks.com/?p=5088
*/
add_action( 'template_redirect', 'bhww_front_end_ssl_template_redirect', 2 );
@bhwebworks
bhwebworks / filter-mailpoet-tags-not-being-stripped.php
Last active Jan 18, 2016
Filter MailPoet tags not being stripped
View filter-mailpoet-tags-not-being-stripped.php
/**
* Filter MailPoet tags not stripped out of emails - add table tags
*
* Located in wysija-newsletters/helpers/articles.php
*
* @link http://blackhillswebworks.com/?p=5648
*/
add_filter( 'mpoet_strip_tags_ignored', 'bhww_core_mailpoet_filter_tags_not_being_stripped' );
@bhwebworks
bhwebworks / Modified pseudo-responsive MailPoet email_template.html
Created Mar 27, 2015
Modified pseudo-responsive MailPoet email_template.html
View Modified pseudo-responsive MailPoet email_template.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" {if #is_rtl} dir="rtl" {/if} >
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{#subject|default:Wysija template}</title>
{#css}
</head>
<body bgcolor="{#styles.html.background|color}" yahoo="fix">
<span style="margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;display:block;background:{#styles.html.background|color};">
@bhwebworks
bhwebworks / Modified MailPoet css.html
Created Mar 27, 2015
Modified MailPoet css.html - responsive images and larger table font size
View Modified MailPoet css.html
<style type="text/css">
/* Based on The MailChimp Reset INLINE: Yes. */
/* Client-specific Styles */
body {
width:100% !important;
-webkit-text-size-adjust:100%;
-ms-text-size-adjust:100%;
margin:0;
padding:0;
}
@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 / add to functions.php
Last active Jan 22, 2016
Filter the genesis_seo_site_title function to use an image for the logo instead of a background image
View add to functions.php
<?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 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;
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 )
{
You can’t perform that action at this time.