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 | |
/** | |
* This will only show renewal date within 30 days or less than the members expiration. | |
* Add this code from line 7+ to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Visit www.paidmembershipspro.com for help. | |
*/ | |
function show_renewal_link_on_30_days( $r, $level ) { | |
if ( empty( $level->enddate ) ) { | |
return false; |
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 | |
/** | |
* Use the pmprowoo_get_membership_price filter to set prices for variable products. | |
* Update the $membership_prices array. | |
* Each item in that array should have a key equal to the membership level id, | |
* and a value equal to an array of the form array( {variable_product_id} => {member_price} ) | |
* | |
* Add this code into a custom plugin. | |
*/ | |
function my_pmprowoo_get_membership_price( $discount_price, $level_id, $original_price, $product ) { |
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 | |
/** | |
* This will allow any post or feed to be open if a user has a special passphrase or key. | |
* Please change 'abc' to a special passphrase/secret key and change this regularly. | |
* This will open any restricted post if a parameter of `&my-key=abc` is passed in the URL, for example my-site.com/feed/?my-key=abc | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_rss_access_filter($hasaccess, $mypost, $myuser, $post_membership_levels) { |
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 | |
// Copy code below to PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
function pmpro_account_bullets_top_example() { | |
echo '<li><strong>Useful Link: </strong><a href="some-link">Click this link to go somewhere</a> </li>'; | |
} | |
add_action( 'pmpro_account_bullets_top', 'pmpro_account_bullets_top_example' ); |
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: My Plugin | |
* Plugin URI: https://www.yoohooplugins.com | |
* Description: Customizations for WordPress | |
* Version: 1.0 | |
* Author: Yoohoo Plugins | |
* Author URI: https://www.yoohooplugins.com | |
*/ |
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 | |
/** | |
* Give access to all members regardless if they have access to the current post or not. | |
* Add this code to your PMPro Customizations - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function give_access_to_all_pmpro_members_example( $hasaccess, $thepost, $theuser, $post_membership_levels ) { | |
if ( pmpro_hasMembershipLevel( array( 7, 8, 9, 10 ) ) ) { | |
$hasaccess = true; | |
} |
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 | |
/** | |
* This will add an image to the top of each post based on if a user has access to that post or not. | |
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function show_icon_based_on_membership_access( $hasaccess, $thepost, $theuser, $post_membership_levels ) { | |
if ( ! empty( $post_membership_levels ) ) { | |
// check if the user has access for a restricted post. |
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 this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Allows customers to select membership duration at checkout. Adjusts the amount charged and expiration date of the membership accordingly. | |
* Requires the Paid Memberships Pro Register Helper Add On to be installed and activated in order to work - https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
*/ | |
function my_pmprorh_init() { |
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 this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* This will add billing fields to Add Member and the user's profile page. | |
*/ | |
function add_billing_fields_to_add_member_profile() { | |
//check for register helper | |
if(!function_exists("pmprorh_add_registration_field")) | |
return; |
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 | |
/** | |
* Custom shortcode to get PMPro RSS Member Key. | |
* Example 1: [pmpro_rss_key] This will return the key for current member. | |
* Example 2: [pmpro_rss_key user_id="2"] This will return the key for user ID 2. | |
* Copy from line 3 onwards into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmprorss_shortcode_get_key( $atts ) { |