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
//Show member number in Members List and Members List CSV export | |
//Requires PMPro Member Number Gist: | |
//https://gist.github.com/strangerstudios/3d2824b8caf56734a54a#file-generate_member_number-php | |
function my_pmpro_members_list_csv_extra_columns($columns) | |
{ | |
$columns["member_number"] = "my_extra_column_member_number"; | |
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
/* | |
Glue code for PMPro Add On Packages and PMPro bbPress. Allows you to sell access to individual forums by using the PMPro Add On Packages | |
*/ | |
function my_pmproap_supported_post_types($post_types) | |
{ | |
$post_types[] = 'forum'; | |
return $post_types; | |
} |
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 to BuddyPress groups and forums (including sub-forums) based on xProfile checkbox selection | |
*/ | |
function my_bp_core_signup_user($user_id) | |
{ | |
$groups = array(1 => "HIKING", | |
2 => "PADDLING", | |
3 => "CYCLING", | |
4=> "SKIING",); |
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
//Actively formats phone number into XXX-XXX-XXXX format | |
function format_phone_number() | |
{ | |
//Adapted from: http://stackoverflow.com/questions/26412623/jquery-or-javascript-to-autoformat-phone-mask | |
echo | |
"<script> | |
<!-- | |
jQuery('#bphone').keyup(function(ev) { | |
var key = ev.which; |
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_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists("pmprorh_add_registration_field")) | |
{ | |
return false; | |
} | |
//define the fields | |
$fields = array(); | |
$fields[] = new PMProRH_Field(" ", "html", array("html"=> |
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 shortcode will display the members list and additional content based on the defined attributes. | |
*/ | |
function pmpromd_shortcode($atts, $content=null, $code="") | |
{ | |
// $atts ::= array of attributes | |
// $content ::= text within enclosing form of shortcode element | |
// $code ::= the shortcode found, when == callback name | |
// examples: [pmpro_member_directory show_avatar="false" show_email="false" levels="1,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
<?php | |
//Add the group code column to the Order CSV export | |
//Set up the column header and callback function | |
function my_pmpro_orders_csv_extra_columns($columns) | |
{ | |
$columns["group_code"] = "my_extra_order_column_notes"; | |
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
//declare as globals | |
global $pmproio_invite_required_levels; | |
global $pmproio_invite_given_levels; | |
$pmproio_invite_required_levels = array(4); | |
$pmproio_invite_given_levels = array(5); | |
define('PMPROIO_CODES',0); | |
define('PMPROIO_CODES_USES',1); |
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
/* | |
PMPro Lock Membership Levels-lock existing members. Add this to your customizations plugin and refresh the page. Recommend deleting the code snippet after the operation is complete. | |
*/ | |
function bulk_lock_all_members() | |
{ | |
global $wpdb; | |
$users = $wpdb->get_results( "SELECT ID FROM $wpdb->users" ); | |
if( $users ) { | |
foreach ( $users as $user ) { | |
update_user_meta( $user->ID, 'pmprolml', 1 ); |
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
/* | |
Remove "Membership Level" on the BuddyPress profile page, and instead only show the membership level name | |
*/ | |
function my_pmpro_bp_show_level_on_bp_profile() { | |
if ( !function_exists('pmpro_getMembershipLevelForUser') ) { | |
return; | |
} | |