Skip to content

Instantly share code, notes, and snippets.

View pippinsplugins's full-sized avatar

Pippin Williamson pippinsplugins

View GitHub Profile
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
get_header(); ?>
<div class="container" id="main-content">
@pippinsplugins
pippinsplugins / gist:3644231
Created September 5, 2012 20:29
Show license keys on success page.
function pw_edd_show_license_on_success( $content ) {
if ( isset( $edd_options['success_page'] ) && is_page( $edd_options['success_page'] ) ) {
if ( isset( $edd_options['show_links_on_success'] ) ) {
// show download links to non logged-in users
if ( ( $purchase_data = edd_get_purchase_session() ) ) {
$downloads = maybe_unserialize( $purchase_data['downloads'] );
function modest_get_projects_per() {
$projects_per = (stripslashes(of_get_option('projects_per')));
$projects_total = (stripslashes(of_get_option('projects_total')));
$project_offset = ($projects_total - $projects_per);
//sets the name for classes depending on projects per line
if ($projects_per == '2') $projects_count_class = "half";
if ($projects_per == '3') $projects_count_class = "third";
if ($projects_per == '4') $projects_count_class = "fourth";
@pippinsplugins
pippinsplugins / gist:3657245
Created September 6, 2012 15:16
Remove one-user-per-user restriction from EDD discounts
function pw_edd_remove_one_use_discounts( $return, $discount_id, $code, $email ) {
if( ! $return ) {
if($discount_id !== false && $email !== "") {
if(
edd_is_discount_active( $discount_id ) &&
edd_is_discount_started( $discount_id ) &&
!edd_is_discount_maxed_out( $discount_id )
) {
$return = true;
}
<a href="http://yoururl.com/checkout?edd_action=add_to_cart&download_id=<?php echo get_the_ID(); ? rel="nofollow">"><span><?php esc_html_e('Add to cart','eStore'); ?></span></a>
<?php
function ecpt_is_odd( $int )
{
return( $int & 1 );
}
function ecpt_get_extension($str)
{
@pippinsplugins
pippinsplugins / EDD Add to Cart Checkout
Created September 8, 2012 02:46 — forked from bryceadams/EDD Add to Cart + Checkout
Easy Digital Downloads - Add to Cart and redirect to Checkout Page
<a href="<?php echo add_query_arg( array( 'edd_action' => 'add_to_cart', 'download_id' => get_the_ID() ), edd_get_checkout_uri() ); ?>">Add to Cart</a>
<?php echo do_shortcode( '[modal id="#"]' ); ?>
function pw_send_to_remote_url( $url ) {
wp_redirect( $url ); exit;
}
add_filter( 'edd_requested_file', 'pw_send_to_remote_url' );
<?php
/**********************************
* This page displays all export code
* I know the code is ugly, but it
* will be updated when 3.3 is
* released with a new meta API
**********************************/
function ecpt_export_page() {