This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change these | |
bucket="s3://bucketname" | |
backupdir="/var/www/vhosts/domain.com/backup" | |
dbuser="dbuser" | |
dbpass="dbpass" | |
dbname="db" | |
cd ~pmpro/backup/ | |
mysqldump -u$dbuser -p$dbpass $dbname > $dbname_`date +'%Y-%m-%d'`.sql | |
gzip $dbname_`date +'%Y-%m-%d'`.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Disable the PMPro https_status_filter | |
* It was interfering with logins | |
*/ | |
function disable_pmpro_https_status_filter() { | |
remove_filter('wp_list_pages', 'pmpro_https_filter'); | |
remove_filter('option_home', 'pmpro_https_filter'); | |
remove_filter('option_siteurl', 'pmpro_https_filter'); | |
remove_filter('logout_url', 'pmpro_https_filter'); | |
remove_filter('login_url', 'pmpro_https_filter'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove the default the_content filter added to membership level descriptions | |
* and confirmation messages in PMPro. | |
* These filters will sometimes cause infinite loop conflicts, e.g. when using | |
* page builders like Site Origin. | |
* Add this code to a custom plugin. | |
*/ | |
function remove_pmpro_level_description_and_confirmation_filters() { | |
remove_filter( 'the_content', 'pmpro_level_description' ); | |
remove_filter( 'pmpro_level_description', 'pmpro_pmpro_level_description' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Strip links out of the level description on the checkout page. | |
Add this code to a custom plugin. | |
*/ | |
function pmpro_level_description_on_checkout_page( $description ) { | |
global $pmpro_pages; | |
if( is_page( $pmpro_pages['checkout'] ) ) { | |
$description = strip_tags( $description ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Template Name: Full Width | |
Template Post Type: post, page, product | |
**/ | |
get_header(); ?> | |
<div id="primary" class="large-12 columns content-area"> | |
<?php do_action('before_main'); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Link discount codes to affiliates. | |
*/ | |
//this is the parameter we're looking for to find affiliates... based on which plugin/etc you are using | |
define('PMPRO_LDC2AFF_KEY', 'wpam_id'); //Affiliates Manager Plugin | |
//define('PMPRO_LDC2AFF_KEY', 'pa'); //WordPress Lightweight Affiliates | |
//define('PMPRO_LDC2AFF_KEY', 'ref'); //AffiliateWP | |
//helper function to get the values from options and make sure they are an array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change when Paid Memberships Pro starts and stops PHP sessions. | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_change_pmpro_sessions_start_and_stop() { | |
// make sure PMPro has loaded | |
if( !function_exists( 'pmpro_start_session' ) ) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* When you pass /?testipn=1 to a WP URL, load our fake IPN data and process it | |
* You can find the parameter string for an IPN notification from the IPN History in PayPal. | |
* Update the parameter string to match the data/orders/etc on your site. | |
*/ | |
function init_test_ipn() { | |
if(!empty($_REQUEST['testipn'])) { | |
parse_str( "transaction_subject=Level 1 at YourSite&payment_date=08:11:17 Jun 06, 2018 PDT&txn_type=subscr_payment&subscr_id=I-725WNH95VPUX&last_name=buyer&residence_country=US&item_name=Level 1 at Your Site&payment_gross=10.00&mc_currency=USD&[email protected]&payment_type=instant&protection_eligibility=Eligible&verify_sign=AXOdEKNaKB34xXs1J9eIeoZ2zZOEAmIExVCQqjTzQT7L1yO6NFySiCY7&payer_status=verified&test_ipn=1&[email protected]&txn_id=04404971C88980238&[email protected]&first_name=test&payer_id=ZPTKKEWFN2F2N&receiver_id=6B3GHP8DY7MTG&item_number=79E46DE577&payment_status=Completed&payment_fee=0.59&mc_fee=0.59&mc_gross=10.00&charset=window |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Gets the full URL for an image given the image filename. | |
function schoolpress_get_image( $image ) { | |
$dir = apply_filters( | |
'schoolpress_images_url', | |
SCHOOLPRESS_URL . '/images/' | |
); | |
return $dir . $image; | |
} | |
?> |