Skip to content

Instantly share code, notes, and snippets.

View pippinsplugins's full-sized avatar

Pippin Williamson pippinsplugins

View GitHub Profile
// make downloads hierarchical
function thesrpr_edd_make_hierarchical($download_args ) {
$download_args['hierarchical'] = true;
return $download_args;
}
add_filter( 'edd_download_post_type_args', 'thesrpr_edd_make_hierarchical' );
@pippinsplugins
pippinsplugins / gist:8907778
Created February 9, 2014 23:32
Custom EDD email templlate
<?php
// create the HTML for the custom template
function pw_edd_custom_email_template() {
echo '<div style="width: 550px; border: 1px solid #1e79c0; background: #ddd; padding: 8px 10px; margin: 0 auto;">';
echo '<div id="edd-email-content" style="background: #f0f0f0; border: 1px solid #9ac7e1; padding: 10px;">';
echo '{email}'; // this tag is required in order for the contents of the email to be shown
echo '</div>';
echo '</div>';
@pippinsplugins
pippinsplugins / gist:8834900
Created February 5, 2014 22:46
Duplicates the EDD downloads pagination
<?php
/*
* Plugin Name: EDD Double Pagination
*/
function pw_edd_duplicate_pagination() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
@pippinsplugins
pippinsplugins / gist:8674199
Created January 28, 2014 19:14
Removes the state field from the required fields on checkout
<?php
function pw_edd_remove_state_from_required_fields( $fields ) {
if( array_key_exists( 'card_state', $fields ) ) {
unset( $fields['card_state'] );
}
return $fields;
}
add_filter( 'edd_purchase_form_required_fields', 'pw_edd_remove_state_from_required_fields' );
@pippinsplugins
pippinsplugins / gist:8653114
Last active September 10, 2017 10:20
Show $0.00 prices as "Free" in EDD.
<?php
/* Plugin Name: Custom Functions */
function pw_format_currency( $formatted, $currency, $price ) {
if( ! is_admin() && $price == 0.00 ) {
return 'Free';
}
return $formatted;
@pippinsplugins
pippinsplugins / gist:8607810
Created January 24, 2014 22:12
An example of how to create a custom email tag in EDD 1.9+
<?php
class EDD_Sample_Email_Tag {
function __construct() {
add_action( 'edd_add_email_tags', array( $this, 'add_sample_tag' ), 100 );
}
<?php
/*
* Plugin Name: Remove Double-Click to Edit for Comments
* Description: Disables the double-click to edit action for comments
* Author: Pippin Williamson
* Version: 1.0
*/
class Remove_Double_Click_To_Edit {
<?php
/**
* Plugin Name: Settings Import / Export Example Plugin
* Plugin URI: http://pippinsplugins.com/building-a-settings-import-and-export-feature
* Description: An example plugin that shows how to create a settings import and export feature
* Author: Pippin Williamson
* Author URI: http://pippinsplugins.com
* Version: 1.0
*/
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
@pippinsplugins
pippinsplugins / gist:7123974
Created October 23, 2013 18:28
Removes the EDD sales sumamry widget
<?php
/*
* Plugin Name: Disable EDD Dashboard Widget
* Description: Removes the EDD sales sumamry widget
* Author: Pippin Williamson
* Version: 1.0
*/
remove_action('wp_dashboard_setup', 'edd_register_dashboard_widgets', 10 );