Skip to content

Instantly share code, notes, and snippets.

View dparker1005's full-sized avatar

David Parker dparker1005

  • Stranger Studios
View GitHub Profile
@dparker1005
dparker1005 / pmpro_remove_now_customization.php
Created June 29, 2017 18:30
Removes the word "now" from the cost text in Paid Memberships Pro
function pmpro_remove_now($cost)
{
$cost = str_replace(" now", "", $cost);
return $cost;
}
add_filter("pmpro_level_cost_text", "pmpro_remove_now", 10, 4);
@dparker1005
dparker1005 / pmpro_import_membership_enddate_customization.php
Last active July 14, 2017 13:06
Adds the 'import membership enddate' field to the Members List page of Paid Memberships Pro and the CSV file generated by it.
<?php
// To use this code, add it to a PMPro Customizations Plugin
// https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
//
// To add 'Import Membership Enddate' to Members List
//
//Add 'Import Membership Enddate' Column to Members List Header
@dparker1005
dparker1005 / pmpro_redirect.php
Created August 22, 2017 18:25
Redirects non-users from blog to levels page in PMPro
/*
Redirect away from certain URLs with PMPro.
Be careful, the code will redirect any URL *containing* the strings in the $urls array.
So e.g., if /not-locked/about/ is public and you have /about/ in the list, it will still be locked down to non-members.
*/
function pmpro_hide_urls()
{
//make sure PMPro is activated
if(!function_exists('pmpro_hasMembershipLevel'))
return;
@dparker1005
dparker1005 / pmproarc_pmpro_custom_autorenewal_checkbox_text.php
Last active August 24, 2017 14:59
Changes the text that shows next to the Automatic Renewals checkbox. To edit text, change "NEW TEXT HERE" in the code and insert into a PMPro customizations plugin.
<?php
add_filter( 'gettext', 'change_auto_renewal_checkbox_text', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_auto_renewal_checkbox_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Yes, renew at %s' :
$translated_text = __( 'NEW TEXT HERE', 'pmpro' );
break;
@dparker1005
dparker1005 / facebook_email_on_checkout.php
Last active July 12, 2018 17:46
Add Facebook Email Field on Checkout
<?php
//Add from here down to the bottom of your PMProcustomizations plugin
function my_pmprorh_init() {
// don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
<?php
//Add from here down to the bottom of your PMProcustomizations plugin
function my_pmprorh_init() {
// don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
@dparker1005
dparker1005 / members_list_international_address_customization.php
Last active July 19, 2018 20:33
Formats address in Members List page for international addresses (i.e. Zip City) without looking at the State field
<?php
//Add from here down to the bottom of your PMPro Customizations plugin
add_action('pmpro_formatted_address', 'pmpro_custom_members_list_address', 10, 9);
function pmpro_custom_members_list_address( $address, $name, $address1, $address2, $city, $state, $zip, $country, $phone ) {
$address = '';
if ( ! empty( $name ) ) {
$address .= $name . '<br/>';
@dparker1005
dparker1005 / pmpro_next_billing_date_customization.php
Last active September 22, 2018 14:56
Adds the next billing date for a recurring membership to the Members List page of Paid Memberships Pro and the CSV file generated by it.
<?php
/*
* To add 'Next Billing Date' to Members List
*/
//Add 'Next Billing Date' Column to Members List Header
function my_pmpro_memberslist_extra_cols_header($theusers)
{
?>
<th><?php _e('Next Billing Date', 'pmpro');?></th>
<?php
#lang racket
(define const? number?)
(define var? symbol?)
(define (ev σ θ e)
(match e
[(? const? e) (cons σ e)]
[(? var? e) (cons σ (hash-ref θ e))]
; Comma here matches any var
[
{
"name": "Checker Me Up",
"description": "Pawns Start in a Checker Board Formation",
"newBoard": "RNBQKNBRP*P*P*P**P*P*P*PP*P*P*P*p*p*p*p**p*p*p*pp*p*p*p*rnbqknbr"
},
{
"name": "Horse Spies",
"description": "Sneaky Horsies",
"newBoard": "nNBQKBNnPPPPPPPP********************************ppppppppNnbqkbnN"