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: PMPro Custom Import | |
| Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
| Description: Custom Import Code for PMPro | |
| Version: .1 | |
| Author: Stranger Studios | |
| Author URI: http://www.strangerstudios.com | |
| */ |
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 | |
| /* | |
| * Add PMPro Billing Fields to Profile | |
| */ | |
| function my_show_extra_profile_fields($user) | |
| { | |
| global $pmpro_states; | |
| ?> |
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 pmproseries_shortcode($atts) { | |
| global $post; | |
| extract(shortcode_atts(array( | |
| 'id' => $post->ID | |
| ), $atts)); | |
| //start output buffering | |
| ob_start(); | |
| $series = new PMProSeries($id); | |
| $series->getPostList(true); //true echoes post list |
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 payment options (as levels) at checkout. | |
| */ | |
| // Define groups of levels. array(1,2) means that levels 1 and 2 are in a group and options will be shown for both levels at checkout for those levels. | |
| global $pmpro_level_groups; | |
| $pmpro_level_groups = array(array(1,2)); | |
| //show options at checkout | |
| function pmprogl_pmpro_checkout_boxes() |
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 | |
| /* | |
| * Force Add PayPal Express + Pay by Check addons to work together | |
| */ | |
| function my_init() { | |
| remove_action("pmpro_checkout_boxes", "pmpropbc_checkout_boxes"); | |
| remove_action("pmpro_checkout_boxes", "pmproappe_pmpro_checkout_boxes", 20); | |
| } | |
| add_action('init', 'my_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
| <?php | |
| /* | |
| * Additional Terms of Service Page example for Register Helper | |
| * applies formatting & shortcodes, uses post title for field label | |
| */ | |
| function my_pmprorh_init() | |
| { | |
| // Set additional Terms of Service post ID here. | |
| $tos_page = 4; |
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 | |
| // Move the default position of the currency symbol for EUR from right to left. | |
| // 50.00€ -> €50.00 | |
| function my_pmpro_currencies($currencies) { | |
| $currencies['EUR']['position'] = 'left'; | |
| return $currencies; | |
| } | |
| add_filter('pmpro_currencies', 'my_pmpro_currencies'); |
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 | |
| /* | |
| * Remember last post ID | |
| */ | |
| function my_wp() { | |
| global $post, $pmpro_pages; | |
| //don't track pmpro pages | |
| if( ! in_array($post->ID, $pmpro_pages)) | |
| setcookie('last_post_viewed', $post->ID, null, '/'); |
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 | |
| /* | |
| * Example code to set subscription updates automatically for referrals (Stripe only) | |
| */ | |
| function my_init() { | |
| //check for referral ID and set a cookie | |
| if(!empty($_REQUEST['referral_id'])) | |
| setcookie('referral_id', $_REQUEST['referral_id'], null, '/'); | |
| } |
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 | |
| /* | |
| * Generate invite codes for all users with a certain membership level. | |
| */ | |
| function my_init() { | |
| if ( ! empty( $_REQUEST['create_invites'] ) && current_user_can( 'manage_options' ) ) { | |
| global $wpdb; |