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 code snippet allows Editors without any PMPro membership level to access any restricted content. | |
* Add this code to your PMPro Customizations plugin - | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmmpro_allow_access_for_editors($hasaccess, $mypost, $myuser, $post_membership_levels){ | |
//If user is an admin allow access. |
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 // do not copy this line. | |
/** | |
* Remove state and phone from required billing fields and hide it the state field. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
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 | |
<?php // do not copy this line. | |
/** | |
* This recipe will change the text "Expiration" to "Renew" | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 //do not copy | |
/** | |
* This recipe allows you to restrict partial user email addresses during checkout. | |
* You will be able to specify that all @paidmembershipspro.com email addresses are allowed to sign up, without | |
* having to enter each user's full email address. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. |
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 // do not copy this line. | |
/** | |
* This recipe Allows you to sell access to individual forums by using the PMPro Add On Packages | |
* Please test and make sure this meets your needs. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
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 // do not copy this line. | |
/** | |
* Sponsored Members setup with child seat costs at checkout. | |
* SPONSOR SEAT + 4 seats 19.95 each | |
* + 5 to 19 @ 17.95 | |
* + 20 to 39 @ $15.95 | |
* + 40 to 79 @ 14.95 | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. |
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 // do not copy this line. | |
/** | |
* This recipe Requires a certain level before registering for another level. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* Edit lines 19,20,33,34 with your site levels. Update message line 22 |
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 following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Move Email And Confirm Email fields before password | |
*/ | |
function pmpro_move_name_fields() { | |
global $pmpro_pages; | |
if(is_page($pmpro_pages['checkout'])) { |
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 from below here... | |
/* | |
* Prevent oembeds from running on a particular page. | |
* Can clear oembed cache with steps here: https://siteorigin.com/clearing-oembed-cache/ | |
*/ | |
function my_pmpro_prevent_oembed($result, $url, $args) { | |
if ( strpos( $_SERVER['REQUEST_URI'] , '/directory/') !== 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
# BACKUP FIRST | |
# This SQL query will set the expiration date | |
# to 2023-02-01 for ALL active membership including users with active subscriptions who are marked NEVER. | |
# a different current enddate. | |
# BACKUP FIRST | |
UPDATE wp_pmpro_memberships_users | |
SET enddate = '2023-02-01 00:00:00' | |
WHERE status = 'active' |