This file contains hidden or 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 'Company' Column to Users List Header | |
function my_pmpro_manage_users_columns($columns) { | |
$columns['company'] = 'Company'; | |
return $columns; | |
} | |
add_filter('manage_users_columns', 'my_pmpro_manage_users_columns'); | |
//Add 'Company' Column to Users List Rows | |
function my_pmpro_manage_users_custom_column($value, $column_name, $user_id) { | |
$theuser = get_userdata( $user_id ); |
This file contains hidden or 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 'Company' Column to Members List Header | |
function my_pmpro_memberslist_extra_cols_header($theusers) | |
{ | |
?> | |
<th><?php _e('Company', 'pmpro');?></th> | |
<?php | |
} | |
add_action('pmpro_memberslist_extra_cols_header', 'my_pmpro_memberslist_extra_cols_header'); | |
//Add 'Company' Column to Members List Rows |
This file contains hidden or 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_pages_shortcode_checkout($content) | |
{ | |
//Check for a specific page by ID or slug | |
if(is_page('100')) | |
{ | |
ob_start(); | |
include(plugin_dir_path(__FILE__) . "templates/checkout-alt.php"); | |
$temp_content = ob_get_contents(); | |
ob_end_clean(); | |
} |
This file contains hidden or 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 the number of simultaneous logins allowed. | |
Change the "2" below to the number required or use any logic you'd like to calculate. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_wp_bouncer_number_simultaneous_logins($num) { | |
return 2; | |
} |
This file contains hidden or 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
/* | |
Count downgrades to free levels as "cancellations" in reports. | |
Paste this into your active theme's functions.php or a custom plugin. | |
Requires PMPro v1.8.8 | |
*/ | |
function my_pmpro_reports_signups_sql($sqlQuery) { | |
//figure out which levels are free | |
$all_levels = pmpro_getAllLevels(true, true); |
This file contains hidden or 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_filter('pmpro_checkout_signon_secure', '__return_false'); //return false for http or true for https |
This file contains hidden or 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: Register Helper Fields | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-register-helper-fields/ | |
Description: Register Helper Initialization Example | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
//we have to put everything in a function called on init, so we are sure Register Helper is loaded |
This file contains hidden or 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: Register Helper - Extra fields | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Extra registration fields | |
Version: .1 | |
Author: Thomas Sjolshagen - PMPro Support | |
Author URI: http://www.strangerstudios.com/ | |
*/ | |
function my_pmprorh_extra_fields_init() |
This file contains hidden or 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
/* | |
Redirect to the membership account page instead of the home page after email validation with the PMPro Email Confirmation add on. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmproec_after_validate_user() { | |
if(is_user_logged_in()) | |
wp_redirect("/membership-account/"); | |
else | |
wp_redirect(wp_login_url("/membership-account/")); |
This file contains hidden or 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
/* | |
Show a login/register link at the bottom of any post that uses the membership shortcode. | |
Note this doesn't check for specific membership levels. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function show_login_register_links_on_member_pages($content) { | |
//bail if PMPro isn't loaded | |
if(!function_exists('pmpro_has_membership_access')) |