Skip to content

Instantly share code, notes, and snippets.

View DevinWalker's full-sized avatar
🌱
Coding for good

Devin Walker DevinWalker

🌱
Coding for good
View GitHub Profile
@DevinWalker
DevinWalker / give-recurring-dummy-subscriptions.php
Last active December 9, 2015 01:10
This will add child subscription payments to a given subscription
<?php
/**
* Create Recurring Dummy Subscriptions
*/
$subscription = new Give_Subscription( 68 );
$args = array(
'subscription_id' => 68,
'amount' => 20,
'transaction_id' => md5(uniqid(rand(), true)),
@DevinWalker
DevinWalker / custom-donation-total-label.php
Last active December 23, 2016 20:36
Customized the Give donation total label globally
/**
* Give Custom Donation Total Label
*
* @return string|void
*/
function my123_custom_donation_total_label(){
return __('My Custom Label', 'my_textdomain');
}
@DevinWalker
DevinWalker / give-addon-banner-activation.php
Last active October 10, 2015 03:05
To use the banner class built into Give's core use the following
<?php
/**
* Give NAME OF ADD-ON Activation Banner
*
* @description: Includes and initializes the activation banner class; only runs in WP admin
* @hook admin_init
*/
function give_myaddon_activation_banner() {
if ( ! class_exists( 'Give_Addon_Activation_Banner' ) && file_exists( GIVE_PLUGIN_DIR . 'includes/admin/class-addon-activation-banner.php' ) ) {
@DevinWalker
DevinWalker / Beanstalk_to_GitHub
Created October 9, 2015 17:19
Move Git Repository from Beanstalk to GitHub with full repository history
#Example moving the DPSG Global Library
# 1 Checkout the Beanstalk Repo
git clone --bare git@codeandtheory.beanstalkapp.com:/dpsg-global-library.git
# 2 Push into your desired GitHub repo. (Please note that you must create the github repo prior to this step)
git push --mirror git@github.com:codeandtheory/dpsg-global-library.git
@DevinWalker
DevinWalker / give-is-user-recent-donor
Created September 21, 2015 19:31
Determine if a user is a recent donor (last 30 days) with this conditional check.
<?php
/**
* Is User Recent Donor (Rename/Prefix)
*
* @description: Display Donors from Last 30 Days
*
* @return bool
*/
function my_give_is_user_recent_donor() {
@DevinWalker
DevinWalker / cmb2-address.php
Created July 29, 2015 22:15
Plugin demonstrating CMB2 address field as repeatable
<?php
/*
* Plugin Name: CMB2 Custom Field Type - Address
* Description: Makes available an 'address' CMB2 Custom Field Type. Based on https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types#example-4-multiple-inputs-one-field-lets-create-an-address-field
* Author: jtsternberg
* Author URI: http://dsgnwrks.pro
* Version: 0.1.0
*/
/**

Simple Optin form example for WordPress

This is a simplified showcase of how you can easily build your own Optin form in WordPress.

It can connect to any API that supports cURL (most of them do). There is no error reporting implemented. It uses exit intent detection script called Ouibounce, which needs to be enqueued in your functions.php

@DevinWalker
DevinWalker / gist:6fb2783c05b46a2ba251
Created April 17, 2015 17:31
WordPress: Loop through Categories and Display Posts Within
<?php
/*
* Loop through Categories and Display Posts within
*/
$post_type = 'features';
// Get all the taxonomies for this post type
$taxonomies = get_object_taxonomies( array( 'post_type' => $post_type ) );
foreach( $taxonomies as $taxonomy ) :
@DevinWalker
DevinWalker / content-product.php
Last active September 19, 2021 23:09
Correct WooCommerce hooks for Total theme template override: woocommerce/content-product.php
<?php
/**
* The template for displaying product content within loops.
*
* Override this template by copying it to yourtheme/woocommerce/content-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
@DevinWalker
DevinWalker / remove-rev-slider-metabox.php
Created May 14, 2014 20:32
This code removed the Revolution Slider metabox on pages, posts and CTPs
/**
* Remove Rev Slider Metabox
*/
if ( is_admin() ) {
function remove_revolution_slider_meta_boxes() {
remove_meta_box( 'mymetabox_revslider_0', 'page', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'post', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'YOUR_CUSTOM_POST_TYPE', 'normal' );
}