This file contains 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 | |
/** | |
* Redirect to a default "members" page unless redirecting back to referrer. | |
* Adjust the URLS for $skip_redirects which it bypasses. | |
* | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_login_redirect_url( $redirect_to, $request, $user ) { | |
// Skip certain redirect_tos always | |
$skip_redirects = array( |
This file contains 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 | |
/** | |
* Replace wp-login.php with a custom slug in all WordPress emails where it's generated. | |
* Add this code to a custom plugin or a child theme's functions.php | |
*/ | |
function my_replace_wp_login_in_emails($args) { | |
// Check if the message contains 'wp-login.php' | |
if (strpos($args['message'], 'wp-login.php') !== false) { | |
// Replace 'wp-login.php' with 'my-login' | |
$args['message'] = str_replace('wp-login.php', 'my-login', $args['message']); // change my-login to the slug of your choice |
This file contains 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 | |
/** | |
* If anyone created a custom print.css file, add this code to a custom plugin to re-enqueue it in your theme or template directory. | |
*/ | |
function my_enqueue_print_style() { | |
if ( file_exists( get_stylesheet_directory() . '/paid-memberships-pro/css/print.css' ) ) { | |
$print_css = get_stylesheet_directory_uri() . '/paid-memberships-pro/css/print.css'; | |
} elseif ( file_exists( get_template_directory() . '/paid-memberships-pro/print.css' ) ) { | |
$print_css = get_template_directory_uri() . '/paid-memberships-pro/print.css'; | |
} else { |
This file contains 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 | |
/* | |
Plugin Name: PMPro SpacesEngine Integration | |
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for integrating Paid Memberships Pro with SpacesEngine | |
Version: 1.0 | |
Author: Brandon Meyer | |
Author URI: https://collabanthnetwork.org | |
*/ |
This file contains 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 | |
/** | |
* Adds approval status column to the members list. | |
* | |
* @param [type] $columns | |
* @return void | |
*/ | |
function my_pmpro_add_memberslist_col_approval( $columns ) { | |
$columns['approval'] = 'Approval Status'; | |
return $columns; |
This file contains 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 | |
/** | |
* Adjust the Woo membership discount only if the member is approved. | |
* This won't discount for pending or denied members. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprowoo_price_adjust_approvals( $discount_price, $lowest_price_level, $price, $product ) { | |
if ( ! class_exists( 'PMPro_Approvals' ) ) { | |
return $discount_price; | |
} |
This file contains 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 | |
/** | |
* Redirect logged-in users away from the login page if already logged-in. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_login_page_redirect() { | |
global $pmpro_pages; | |
if ( is_page( $pmpro_pages['login'] ) && is_user_logged_in() ) { | |
wp_redirect( home_url( '/page-slug/' ) ); |
This file contains 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 | |
// add the below to your functions file | |
// then visit the page that you want to see | |
// the enqueued scripts and stylesheets for | |
function se_inspect_styles() { | |
global $wp_styles; | |
echo "<h2>Enqueued CSS Stylesheets</h2><ul>"; | |
foreach( $wp_styles->queue as $handle ) : | |
echo "<li>" . $handle . "</li>"; |
This file contains 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 | |
/** | |
* Remove the Subscription Delay for members and past members. | |
* This will change the price of the initial amount to the billing amount for past members. | |
* Tweak this code accordingly to your needs or hire a developer. | |
* | |
* To add this code to your site, please follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_one_time_sub_delay( $checkout_level ) { |
This file contains 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 | |
/** | |
* Removes custom trial for active and past members. | |
* Adjust this code accordingly to price your membership level when removing the trial. | |
* To add this code to your site, please follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_remove_custom_trial( $level ) { | |
if ( is_admin() || ! is_user_logged_in() ) { | |
return $level; |
NewerOlder