Skip to content

Instantly share code, notes, and snippets.

View jakejackson1's full-sized avatar

Jake Jackson jakejackson1

View GitHub Profile
@polevaultweb
polevaultweb / edd_perpetual_discounts.php
Last active June 28, 2022 08:31
EDD - Allow discounts to be set to apply to all renewals
<?php
// Add new Discount setting the to discount add and edit forms
add_action( 'edd_add_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_add_form' ) );
add_action( 'edd_edit_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_edit_form' ) );
// Handle saving the settings on form submission
add_filter( 'edd_update_discount', 'edd_perpetual_discounts_add_meta' );
add_filter( 'edd_insert_discount', 'edd_perpetual_discounts_add_meta' );
@adamcapriola
adamcapriola / page_discourse-sso.php
Last active March 24, 2020 14:21
WordPress Page Template for SSO with Discourse
<?php
/**
* Template Name: Discourse SSO
* Author: Adam Capriola
* Version: 1.1
* Author URI: https://meta.discourse.org/users/AdamCapriola/activity
* Adapted From: https://github.com/ArmedGuy/discourse_sso_php
* Uses: https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045
*
*/
@spivurno
spivurno / gw-gravity-forms-advanced-merge-tags.php
Last active May 5, 2022 18:54
Gravity Wiz // Gravity Forms // Advanced Merge Tags
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-advanced-merge-tags.php
*/
/**
* Gravity Wiz // Gravity Forms // Advanced Merge Tags
*
* Adds support for several advanced merge tags:
@andreyvit
andreyvit / fpdi_with_annots.php
Created March 12, 2012 07:16
FPDI extension to preserve external hyperlinks
<?php
// FPDI extension that preserves hyperlinks when copying PDF pages.
//
// (c) 2012, Andrey Tarantsov <andrey@tarantsov.com>, provided under the MIT license.
//
// Published at: https://gist.github.com/2020422
//
// Note: the free version of FPDI requires unprotected PDFs conforming to spec version 1.4.
// I use qpdf (http://qpdf.sourceforge.net/) to preprocess PDFs before running through this
@alexkingorg
alexkingorg / hex_color_mod.php
Created September 3, 2011 23:42
Change the brightness of the passed in hex color in PHP
<?php
/**
* Change the brightness of the passed in color
*
* $diff should be negative to go darker, positive to go lighter and
* is subtracted from the decimal (0-255) value of the color
*
* @param string $hex color to be modified
* @param string $diff amount to change the color