Skip to content

Instantly share code, notes, and snippets.

@stephywells
stephywells / Void Shareasale transaction from EDD
Last active July 6, 2020 07:03
Void Shareasale commission when EDD payment is refunded
function s11_void_refunded( $payment ) {
global $edd_options;
if ( empty( $payment->ID ) ) {
return;
}
$merchant_id = $edd_options['sas_affiliate_id']; // TODO: If not using the EDD Shareasale addon, replace with your affiliate id
$api_token = 'aflj24sadflk3'; // TODO: Set API token here
$secret_key = 'asldkjlj12312oiksdlfksld'; // TODO: Set secrect key
@stephywells
stephywells / history-downloads.php
Last active November 21, 2016 23:02
EDD faster downloads page
<?php
// New function to get the cart details for an array of purchase ids
function edd_get_user_payments_cart_detail( $payment_ids, $include_bundle_files = false ) {
global $wpdb;
$payment_ids = array_filter( $payment_ids, 'is_numeric' );
$payments = $wpdb->get_results("SELECT post_ID, meta_value FROM {$wpdb->postmeta} WHERE meta_key = '_edd_payment_meta' AND post_ID in (" . implode( $payment_ids, ',' ). ")");
$all_details = array();
if ( ! empty( $payments ) ) {
@stephywells
stephywells / word-cloud.php
Last active October 7, 2016 19:05
Use the [cloud words="Awesome,Fabulous"] shortcode to create a cloud of words
<?php
/*
Plugin Name: S11 Word Cloud
Description: Use the [cloud words="Awesome,Fabulous"] shortcode to create a cloud of words
Version: 1.0
Author URI: http://strategy11.com
Author: Strategy11
*/
add_shortcode( 'cloud', 's11_word_cloud' );
@stephywells
stephywells / blank-template.php
Created August 10, 2015 17:14
Blank WordPress template
<?php
/*
Template Name: Blank template
*/
wp_head();
if (have_posts()) : while (have_posts()) : the_post();
the_content();
endwhile; endif;
@stephywells
stephywells / formidable-mediavault.php
Created July 25, 2015 21:59
Send Formidable uploads to Media Value
<?php
/**
* Plugin Name: Formidable MediaVault
* Plugin URI: https://www.formidablepro.com
* Description: This plugin will allow you to use
* Version: 1.0.0
* Author: Strategy11
* Author URI: http://strategy11.com
* License: GPL2
*/
@stephywells
stephywells / allow_single_license.php
Created July 12, 2015 03:17
Allow all downloads in a EDD bundle to use a sinle license
<?php
/**
* Allow multiple downloads in a bundled Easy Digital Downloads
* product be updated from a single license
* 1. Create 1 download set to generate a license
* 2. Create more downloads and do not set them to generate licenses
* 3. Create one more download and bundle all the downloads from #1 and #2
*/
function s11_allow_single_license() {
@stephywells
stephywells / class-public.php
Created February 9, 2015 20:32
Social sharing by Danny mod
<?php
if( ! defined( "DVKSS_VERSION" ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
class DVKSS_Public {
@stephywells
stephywells / frm_completed_entries.php
Last active June 10, 2022 11:30
Formidable Shortcodes
<?php
//* Do NOT include the opening php tag
// Add this to your theme functions.php or a new plugin
// to enable a shortcode to return a list of entry ids with completed payments
// 1. Create a view to show only the entries with completed payments
// 2. Go down to the "advanced settings" section of your view, and add a filter:
// Entry id is equal to [frm_completed_entries form_id=5]
// 3. Replace 5 with the id of your form.
@stephywells
stephywells / frm_bulk_choices.php
Last active August 29, 2015 14:02
Formidable snippets
<?php
//* Do NOT include the opening php tag
// Add this to your theme functions.php or a new plugin
// to add a list of predefined choices on the bulk options popup.
add_filter('frm_bulk_field_choices', 'add_custom_frm_options');
function add_custom_frm_options($opts){
// change 'Set Name' to whatever label you want shown on the left side of the bulk field options popup
// add each option to the array