Skip to content

Instantly share code, notes, and snippets.

View cklosowski's full-sized avatar

Chris Klosowski cklosowski

View GitHub Profile
@cklosowski
cklosowski / ck-edd-author-support.php
Created June 20, 2014 04:27
Plugin file to add author support to EDD
<?php
/*
Plugin Name: EDD Author Support
Plugin URI: http://easydigitaldownloads.com
Description: Adds Author Support to the Downloads Post Type in EDD
Version: 1.0
Author: Chris Klosowski
Author URI: http://filament-studios.com
License: GPLv2
*/
@cklosowski
cklosowski / update-payment-test.php
Created October 7, 2014 04:23
Update Payment Test
<?php
public function test_update_payment_amount() {
$pre_update_total_earnings = get_option( 'edd_earnings_total' );
$pre_update_payment_amount = edd_sanitize_amount( edd_get_payment_amount( $this->_payment_id ) );
$payment_download = array(
'id' => $this->_post->ID,
'price_id' => '1',
'amount' => '100',
'quantity' => '1'
@cklosowski
cklosowski / edd-ck-commenter-has-purchased.php
Last active August 29, 2015 14:14
See if a commenter has purchased a given download ID
<?php
/*
* Plugin Name: Easy Digital Downloads - Commenter has purchased
* Description: Adds a 'Purchased' tag after a commenter who's purchased a download
* Author: Chris Klosowski
* Version: 1.0
*/
/**
* NOTE: This is currently not very performant. If an email address has a lot
#jetpack_summary_widget .hndle {
background: inherit !important;
color: inherit !important;
}
@cklosowski
cklosowski / getrepo
Created April 15, 2015 16:29
Quickly checkout a repo from the EDD Org
#!/usr/bin/env bash
if [ $# -lt 2 ]; then
echo "usage: $0 <plugin/theme> <repo-slug>"
exit 1
fi
TYPE=$1"s"
REPO=$2
echo "Changing Directory to:"
@cklosowski
cklosowski / on_this_date.php
Last active August 29, 2015 14:19
Gives a shortcode of [on_this_date] to display posts from this day, in all years from a site.
<?php
/*
Plugin Name: On This Date
Plugin URI: https://kungfugrep.com/
Description: Gives a shortcode [on_this_date] to show posts from this day of the month in all years
Version: 0.1
Author: Chris Klosowski
Author URI: https://kungfugrep.com
License: GPLv2 or later
*/
@cklosowski
cklosowski / .bash_profile
Last active August 29, 2015 14:19
Quick Command line alias to get a set of WordPress Salts for wp-config.php
# Add this to your .bashrc (linux) or .bash_profile (OS X)
alias getsalts="curl https://api.wordpress.org/secret-key/1.1/salt/"
# Changes to these files require closing and reopening a new terminal session to be recognized
@cklosowski
cklosowski / after-reply-link.php
Created May 29, 2015 04:23
Quick hook into the Twenty Fifteen Reply to link
@cklosowski
cklosowski / woocommerce-fees-by-state.php
Created August 5, 2015 06:09
Add fees to the WooCommerce cart, based on the state chosen for shipping
<?php
/**
* Plugin Name: WooCommerce - Fees by State
* Plugin URI: https://filament-studios.com/
* Description: Add Fees to the cart based off the shipping state
* Version: 1.0
* Author: Filament Studios
* Author URI: https://filament-studios.com
* License: GPL-2.0+
*/
@cklosowski
cklosowski / ssp-nginx.conf
Created November 11, 2015 15:40
Possible fix for Nginx and PHP-FPM with Seriously Simple Podcasting
location ~* ^/podcast-download/ {
try_files $uri $uri/
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}