Skip to content

Instantly share code, notes, and snippets.

View pippinsplugins's full-sized avatar

Pippin Williamson pippinsplugins

View GitHub Profile
@pippinsplugins
pippinsplugins / gist:3939773
Created October 23, 2012 16:13
Compilation of tutorials and articles on how to write extensible WordPress Plugins
http://pippinsplugins.com/modular-plugins-presentation-from-wordcamp-kansas-city-2012/
http://pippinsplugins.com/lets-talk-extensible-code/
http://wp.tutsplus.com/tutorials/the-beginners-guide-to-wordpress-actions-and-filters/
http://wp.tutsplus.com/tutorials/plugins/writing-extensible-plugins-with-actions-and-filters/
@pippinsplugins
pippinsplugins / gist:8607810
Created January 24, 2014 22:12
An example of how to create a custom email tag in EDD 1.9+
<?php
class EDD_Sample_Email_Tag {
function __construct() {
add_action( 'edd_add_email_tags', array( $this, 'add_sample_tag' ), 100 );
}
<?php
/**
* Plugin Name: Settings Import / Export Example Plugin
* Plugin URI: http://pippinsplugins.com/building-a-settings-import-and-export-feature
* Description: An example plugin that shows how to create a settings import and export feature
* Author: Pippin Williamson
* Author URI: http://pippinsplugins.com
* Version: 1.0
*/
@pippinsplugins
pippinsplugins / rcp_login_form.php
Created October 9, 2012 17:52
Custom RCP Login Form Short Code to Redirect User to Previous Pag
// user login form
function pw_rcp_login_form( $atts, $content = null ) {
global $post;
$prev_page = $_SERVER['HTTP_REFERER'];
extract( shortcode_atts( array(
'redirect' => $prev_page,
'class' => 'rcp_form'
@pippinsplugins
pippinsplugins / gist:ececad5d57e3946c5af3
Last active November 3, 2022 06:05
Adds billing address fields to Restrict Content Pro
<?php
/**
* Plugin Name: Restrict Content Pro - Collect Billing Address
* Description: Collect customers billing address during registration through Restrict Content Pro
* Author: Pippin Williamson
* Version: 1.0
*/
class RCP_Billing_Address {
<?php
/**
* Upgrade Functions
*
* @package Easy Digital Downloads
* @subpackage Download Functions
* @copyright Copyright (c) 2012, Pippin Williamson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.3.1
<?php
#
# rt-theme loop
#
global $args,$content_width,$paged;
add_filter('excerpt_more', 'no_excerpt_more');
//varialbles
$video_width = ($content_width =="960") ? 940 : 606;
@pippinsplugins
pippinsplugins / gist:11402562
Last active December 15, 2021 17:07
Custom user fields for Restrict Content Pro
<?php
/*
Plugin Name: Restrict Content Pro - Custom User Fields
Description: Illustrates how to add custom user fields to the Restrict Content Pro registration form that can also be edited by the site admins
Version: 1.0
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
@pippinsplugins
pippinsplugins / edd_email_conf.php
Last active December 5, 2021 15:59
Add email confirmation to EDD
<?php
function pw_edd_add_email_confirmation() {
?>
<p>
<label class="edd-label" for="edd-email-confirm">
<?php _e('Confirm Your Email Address', 'easy-digital-downloads'); ?>
<span class="edd-required-indicator">*</span>
</label>
<span class="edd-description" id="edd-email-description"><?php esc_html_e( 'Please confirm your email address.', 'easy-digital-downloads' ); ?></span>
@pippinsplugins
pippinsplugins / gist:d973776836ab984aea06
Created September 3, 2014 22:02
Sets an affiliate user's role to a specific role when being added as an affiliate
<?php
/*
* Plugin name: Affiliate role on registration
*/
function pw_affwp_set_role_on_registration( $affiliate_id = 0 ) {
$user_id = affwp_get_affiliate_user_id( $affiliate_id );
$user = new WP_User( $user_id );
$user->add_role( 'affiliate' );