Skip to content

Instantly share code, notes, and snippets.

@nickcernis
nickcernis / functions.php
Last active January 24, 2016 21:23
Fix for the wpMandrill WordPress plugin for blogs that send both plain text and HTML email
<?php
// Add to functions.php and leave the “Content” box unticked in Settings > Mandrill
// Be sure to omit the opening <?php tag when copying this code
// Add paragraph breaks to plain text notifications sent by Mandrill
add_filter('mandrill_payload', 'wpmandrill_auto_add_breaks');
function wpmandrill_auto_add_breaks($message) {
$html = $message['html'];
@mayeenulislam
mayeenulislam / Default Taxonomy Term for CPT
Last active April 5, 2023 11:07
Make Default taxonomy term for Custom Post Type - WordPress
/**
* Author: Michael Fields
* Source: http://wordpress.mfields.org/2010/set-default-terms-for-your-custom-taxonomies-in-wordpress-3-0/
* Thanks a lot for the nice tweak
*/
/**
* Define default terms for custom taxonomies in WordPress 3.0.1
*
@spivurno
spivurno / gist:6399284
Created August 31, 2013 16:32
MOD: Better Limit Submissions Per Time Period by User or IP (without hiding form & spanning limit across a group of forms)
<?php
/**
* MOD: Better Limit Submissions Per Time Period by User or IP (without hiding form & spanning limit across a group of forms)
*
* Based On: http://gravitywiz.com/2012/05/12/limit-ip-to-one-submission-per-time-period
* Video: http://screencast.com/t/I11vWq02Qswn
*
* Note: This mod does not require the original snippet. Most of the parameters still function the same as the snippet it
* is based on. The only exception is the 'form_id' parameter which now accepts an array of form IDs rather than a single
* form ID.