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
/* | |
Add this function to a custom plugin. | |
Update your membership confirmation text then to include a reminder about confirming your email. | |
*/ | |
function pmpro_hide_account_page_until_validated() { | |
//bail if pmpro or the email confirmation addon is not loaded | |
if(!function_exists('pmpro_getMembershipLevelForUser') || !function_exists('pmproec_isEmailConfirmationLevel')) | |
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
/* | |
If you add this code into a plugin, then the PMPro Email Templates addon | |
will allow you to set/change the body of the email through its UI. | |
You can then send an email using this template using code like: | |
$email = new PMProEmail(); | |
$email->template = 'my_email_template_name'; | |
$email->email = 'email@youaresendingto.com'; | |
$email->send(); |
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
//add this to your wp-config.php file | |
session_start(); | |
if(!empty($_REQUEST['debug']) || !empty($_SESSION['WP_DEBUG'])) { | |
define('WP_DEBUG', true); | |
//define('WP_DEBUG_LOG', true); | |
$_SESSION['WP_DEBUG'] = true; | |
} elseif(isset($_REQUEST['debug'])) { | |
define('WP_DEBUG', false); | |
unset($_SESSION['WP_DEBUG']); | |
} 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
/* | |
Test Stripe webhook events | |
Add to a custom plugin, then visit /?teststripe=1 | |
*/ | |
function init_test_stripe() { | |
if(!empty($_REQUEST['teststripe'])) { | |
$_REQUEST['event_id'] = 'evt_9ktqwT5xFlKNOp'; //EDIT THIS to be the ID of an actual recurring payment event in your account | |
require_once(PMPRO_DIR . "/services/stripe-webhook.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
<?php | |
/* | |
Sample method to show a level's Member Badge on the table layout of the | |
Membership Levels page when using the Advanced Levels Page Shortcode Add On. | |
*/ | |
function my_pmproal_extra_cols_before_header( ) { | |
echo '<th>Badge</th>'; | |
} | |
add_action( 'pmproal_extra_cols_before_header', 'my_pmproal_extra_cols_before_header'); |
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 | |
/* | |
Sample method to show a level's Member Badge on the three column layout of the | |
Membership Levels page when using the Advanced Levels Page Shortcode Add On. | |
*/ | |
function my_pmproal_before_level_member_badge( $level_id, $layout ) { | |
if( function_exists( 'pmpromb_getBadgeForLevel' ) ) { | |
$image = pmpromb_getBadgeForLevel($level_id); | |
if( ! empty( $image ) && $layout == '3col' ) { | |
echo '<img class="pmpro_member_badge" src="' . esc_url($image) . '" border="0" />'; |
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
/* | |
Change PMPro CPT to redirect to the login page instead of the chosen "Redirect To" page | |
if the user is logged out. | |
*/ | |
function my_pmprocpt_redirect_to($redirect_to) { | |
if(!is_user_logged_in()) { | |
$redirect_to = wp_login_url($_SERVER['REQUEST_URI']); | |
} | |
return $redirect_to; |
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 | |
/* | |
1. Make sure PEAR Mail and PEAR Net_SMTP are installed. | |
2. Add this php script somewhere on your server. (Edit the appropriate lines.) | |
3. The script assumes a Gmail email and emailing a Verizon VText email address to send via text message. | |
4. Then add a crontab line like this somewhere send you a message every 2 hours. | |
55 */2 * * * php /var/scriptfolder/stillfat.php > /dev/null 2>&1 | |
*/ | |
require_once('Mail.php'); |