Skip to content

Instantly share code, notes, and snippets.

@ashleyfae
ashleyfae / rcp-paypal-express-process-webhooks.php
Created July 12, 2019 14:31
RCP - PayPal Express webhook processing example
<?php
/**
* Process PayPal IPN
*
* @access public
* @since 2.1
* @return void
*/
public function process_webhooks() {
<?php
/**
* Authorize.net Payment Gateway
*
* @package rcp-authorize-net
* @copyright Copyright (c) 2019, Restrict Content Pro team
* @license GPL2+
* @since 1.0
*/
<?php
/**
* Authorize.net Payment Gateway
*
* @package rcp-authorize-net
* @copyright Copyright (c) 2019, Restrict Content Pro team
* @license GPL2+
* @since 1.0
*/
@ashleyfae
ashleyfae / rcp-payment-gateway-init.php
Created July 12, 2019 13:44
RCP custom payment gateway - init() method
<?php
/**
* Get things going
*
* @access public
* @since 1.0
* @return void
*/
public function init() {
global $rcp_options;
@ashleyfae
ashleyfae / class-rcp-payment-gateway.php
Created July 12, 2019 13:41
RCP payment gateway base class
<?php
/**
* Payment Gateway Base Class
*
* You can extend this class to add support for a custom gateway.
* @link http://docs.restrictcontentpro.com/article/1695-payment-gateway-api
*
* @package Restrict Content Pro
* @subpackage Classes/Gateway
* @copyright Copyright (c) 2017, Pippin Williamson
@ashleyfae
ashleyfae / rcp-mailchimp-pro-free-status.php
Created February 11, 2019 13:58
RCP MailChimp Pro: Returns the "free" STATUS merge var value for unpaid memberships.
<?php
/**
* Plugin Name: Restrict Content Pro - MailChimp Pro "Free" Status
* Description: Returns the "free" STATUS merge var value for unpaid memberships.
* Version: 1.0
* Author: Restrict Content Pro Team
*/
/**
* Change `STATUS` merge var to `free` for unpaid users on initial registration.
@ashleyfae
ashleyfae / rcp-billing-address.php
Last active December 5, 2017 10:14 — forked from pippinsplugins/gist:ececad5d57e3946c5af3
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 {
@ashleyfae
ashleyfae / novelist-series-archive-orderby.php
Created July 14, 2017 13:13
Novelist: Order series archive by publication date
<?php
/**
* Modify Book Query
*
* Modifies the WP_Query to change the series archive "orderby" parameter to use
* the book's publication date rather than the number in the series. This
* eliminates the need to fill out the book series number.
*
* @param WP_Query $query
*
@ashleyfae
ashleyfae / rcp-always-show-excerpt.php
Created January 10, 2017 17:39
Always show post excerpts
<?php
/**
* Always show an excerpt.
*
* @param null|array|string $value The value get_metadata() should return - a single metadata value, or an array of values.
* @param int $post_id Object ID.
* @param string $meta_key Meta key.
* @param bool $single Whether to return only the first value of the specified $meta_key.
*
@ashleyfae
ashleyfae / rcp-edit-admin-email-message.php
Created January 9, 2017 10:31
Edit the contents of the admin expired email notice.
<?php
/**
* Append text to admin expired email.
* Also convert template tags.
*
* @param string $admin_message Default admin message contents.
* @param int $user_id ID number of the expired user.
*
* @return string New admin message contents.