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
# | |
# Sometimes when upgrading WP and/or moving between servers, user_activation_key values get out of whack. | |
# This query will remove ones with $ in it. WP will see the blank key and create a new good one. | |
# | |
UPDATE `wp_users` SET user_activation_key = '' WHERE user_activation_key LIKE '%$%' |
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
$level_id = 1; | |
$user_id = 1; | |
$level = pmpro_getLevel($level_id); | |
//set enddate if the level has one | |
if(!empty($level->expiration_number)) | |
{ | |
$custom_level = array( | |
'user_id' => $user_id, | |
'membership_id' => $level_id, |
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 | |
/* | |
Don't cancel subscriptions if a user's level is changed to another one in the admin. | |
If set to "none" it will be cancelled though. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
//filter cancellation | |
function my_pmpro_cancel_previous_subscriptions($cancel) | |
{ |
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 | |
/* | |
Update contact form to send "From" the user. | |
Assumes form #1 and that field #1 is the name and field #2 is the email address. | |
*/ | |
add_action( 'ninja_forms_email_admin', 'pmpro_ninja_forms_change_from_address' ); | |
function pmpro_ninja_forms_change_from_address(){ | |
global $ninja_forms_processing; | |
if( 1 == $ninja_forms_processing->get_form_ID() ) { |
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
function foundation_init() { | |
wp_enqueue_style( | |
'bootstrap', | |
get_stylesheet_directory_uri() . | |
'/foundation/css/foundation.min.css', | |
'style', | |
'5.0' | |
); | |
wp_enqueue_script( | |
'bootstrap', |
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
/* | |
Membership Column for PMPro WooCommerce | |
*/ | |
function pmprowc_membership_column_definition($columns) | |
{ | |
if(!function_exists("pmpro_getLevel")) | |
return; | |
$columns['pmprowc_membership_level'] = __( 'Membership Level', 'pmpro' ); | |
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
function my_pmpro_set_express_checkout_nvpstr($nvpStr, $order) | |
{ | |
$nvpStr .= "&LOCALECODE=en_US"; | |
return $nvpStr; | |
} | |
add_filter('pmpro_set_express_checkout_nvpstr', 'my_pmpro_set_express_checkout_nvpstr', 10, 2); |
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
/* | |
Give members participant role and others spectator. | |
1. Go to Settings --> Forums and change the "Auto role" to checked/Spectator. | |
2. Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_after_change_membership_level($level_id, $user_id) | |
{ | |
if($level_id == 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
function my_iflychat_check_access_filter($access) | |
{ | |
if(!is_admin() && function_exists("pmpro_hasMembershipLevel") && !pmpro_hasMembershipLevel()) | |
$access = false; | |
return $access; | |
} | |
add_filter('iflychat_check_access_filter', 'my_iflychat_check_access_filter'); |