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

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 / 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() {
# custom login link
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L]
# custom login link
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L]
@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 / .gitignore
Created September 25, 2012 01:51 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
/**
* Give function to reorder array keys
* @see: http://php.net/manual/en/function.ksort.php
* reorder the keys of an array in order of specified keynames; all other nodes not in $keynames will come after last $keyname, in normal array order
* @param array &$array - the array to reorder
* @param mixed $keynames - a csv or array of keynames, in the order that keys should be reordered
*/
function give_9812491_my_array_reorder_keys(&$array, $keynames){
if(empty($array) || !is_array($array) || empty($keynames)) return;
if(!is_array($keynames)) $keynames = explode(',',$keynames);
@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 / jflow-demo-head.html
Last active December 15, 2015 18:59
Include the jFlow scripts in your document head - The first step to setting up any jQuery plugin is ensuring you have your necessary stylesheets and javascript included in your document. The best place is the head of your document head to ensure that all necessary scripts are loaded first by the browser.
<head>
<link href="styles/jflow.style.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="scripts/jflow.plus.min.js" type="text/javascript"></script>
<script type="text/javascript">
@DevinWalker
DevinWalker / jflow-styles.css
Created April 4, 2013 06:01
Styles for the jFlow Slider demo
#sliderContainer { width: 940px; height: 300px; position: relative; border-top: 5px solid #999; border-bottom: 5px solid #999; margin: 0 auto; }
.slideContent { background:url("../images/contentBg.png") repeat scroll 0 0 transparent; position: absolute; bottom:0px; right:0px; padding: 10px; width: 920px; }
.slide h3 { font: 26px/1em 'Rokkitt', serif; color: #FFF; margin: 0 0 5px 0; }
.slide p { font-size: 14px; color: #FFF; margin: 0; }
.jFlowSlideContainer { overflow: hidden; }