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 handles loading a file from the /protected-directory/ directory. | |
(!) Be sure to change line 19 below to point to your protected directory if something other than /protected/ | |
(!) Be sure to change line 66 below to the level ID or array of level IDs to check for the levels you need. | |
(!) Add this code to your active theme's functions.php or a custom plugin. | |
(!) You should have a corresponding bit of code in your Apache .htaccess file to redirect files to this script. e.g. | |
### |
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 specific members-only categories back to main loop | |
* when filtering searches and archives. | |
* Updated for PMPro 3.0+. | |
* | |
* 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 | |
/** | |
* Send extra expiration warning emails with individual templates. | |
* Make sure the Extra Expiration Warning Emails Add On is also active. | |
* https://www.paidmembershipspro.com/add-ons/extra-expiration-warning-emails-add-on/ | |
* | |
* Then add this code into a custom plugin or code snippet. | |
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
*/ | |
// Tell the expiration warnings add on to use our templates. |
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 | |
/** | |
* Functions affecting admins and the admin dashboard. | |
*/ | |
/** | |
* Return array of fields found in the wp_users table. | |
* This function used in the others below to determine if a key entered in a search like "email:address@domain.com" | |
* is referencing the user_email column of the wp_users table or a unique meta key. | |
*/ | |
function my_pmpro_get_user_table_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
/** | |
* Don't let existing members checkout for a free 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/ | |
*/ | |
function my_pmpro_registration_checks_stop_free_checkouts( $okay ) { | |
global $pmpro_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
## | |
# Clean passwords out of access logs. | |
# Be sure to update the LOG_FILE line to match the location of your log file. | |
# This will edit your log files. You can back it up and then delete the backup if this works. | |
# This will also create a file scrubbed_emails.txt with a list of affected emails. | |
# This requires that both the password and password2 fields be in the logs. | |
# If you don't have password2 fields, edit the script to use the field that comes after password in your logs. | |
## | |
#!/bin/bash |
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 | |
/** | |
* Currently, the PMPro user fields GUI does not allow you to choose | |
* the checkbox_grouped field type. | |
* | |
* These fields can be added via custom code though. If you want to manage some | |
* aspects of the field in the GUI, you can create a multiselect field, | |
* then swap it to the checkbox group using this code. | |
* | |
* You can add this recipe to your site by creating a custom plugin |
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 | |
/** | |
* Integrations: Paid Memberships Pro | |
* | |
* @package AffiliateWP | |
* @subpackage Integrations | |
* @copyright Copyright (c) 2016, Sandhills Development, LLC | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* @since 1.8 | |
*/ |
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 all users to a very specific page on login. | |
* This should work no matter what login form/etc you are using. | |
* If it doesn't work, maybe the 999 priority needs to be higher. | |
* If you want to respect the redirect_to param or earlier callbacks | |
* that overwrite it, uncomment the section at the top of the function. | |
* | |
* You can add this code to your site using the Code Snippets plugin or by | |
* placing the code into a custom plugin or your theme's functions.php. |
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
/* | |
Define the global array below for your main accounts and sponsored levels. | |
Array keys should be the main account level. | |
*/ | |
global $pmprosm_sponsored_account_levels; | |
$pmprosm_sponsored_account_levels = array( | |
//set 5 seats at checkout | |
1 => array( | |
'main_level_id' => 1, //redundant but useful | |
'sponsored_level_id' => array(2,3), //array or single id |
NewerOlder