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 Customizations 2 - Billing to Profile | |
* | |
* Add PMPro billing fields to the edit user profile page. | |
* | |
* You must have installed both Paid Memberships Pro and the Register Helper plugins | |
* | |
* https://github.com/strangerstudios/pmpro-register-helper | |
*/ |
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 // do not include in Customizations plugin if copying and pasting | |
/** | |
* Plugin Name: Add a Currency to global | |
* | |
* This code gist illustrates a way to customize the format of how your currency displays. | |
* | |
* In this example, we will change the PMPro Danish Krone currency | |
* | |
* from DKK 1,495.00 | |
* to DKK 1 495,00 |
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 | |
$shortcodes_slug = 'memberlite-shortcodes'; | |
$shortcodes_file = WP_PLUGIN_DIR . "/$shortcodes_slug/$shortcodes_slug.php"; | |
$shortcodes_info = get_plugin_data( $shortcodes_file ); | |
?> | |
<div class="plugin-card plugin-card-<?php echo $shortcodes_slug; ?>"> | |
<div class="plugin-card-top"> | |
<div class="name column-name"> | |
<h3> | |
<a href="<?php echo $shortcodes_info['PluginURI']; ?>" target="_blank"> |
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
jQuery(document).ready(function($){ | |
$('#pmpro_county_div').appendTo($('#bzipcode').parent()); | |
$('#pmpro_checkout_box-checkout_boxes').css('display','none'); | |
}); |
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 // Do not include in Customizations plugin | |
/** | |
* pmpro_checkout_level Use `pmpro_checkout_level` to redirect and interject communication with users during checkout. | |
* | |
* @param array $levels The array created in admin | |
* | |
* @return array Output of the array | |
*/ | |
function pmpro_redirect_during_checkout( $level ) { | |
// Check to see if the current user is downgrading (Gold to Silver or Gold to Free) |
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 // Do not include in Customizations plugin | |
/** | |
* pmpro_levels_array This filter allows us to alter what winds up as the Levels array | |
* | |
* @param array $levels The array created in admin | |
* | |
* @return array Output of the array | |
*/ | |
function adjusting_the_pmpro_levels_array( $levels ) { | |
$newlevels = array(); |
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 // do no include in Customizaations Plugin | |
/** | |
* Plugin Name: PMPro Levels Popup | |
* Description: Add Level selection to a popup | |
*/ | |
add_shortcode( 'pmpro-levels2-popup', 'pmpro_levels_select_shortcode2' ); | |
function pmpro_levels_select_shortcode2() { | |
global $wpdb, $pmpro_msg, $pmpro_msgt, $current_user; |
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 Admin Only Member Directory Profile | |
* Description: Remove area in profile with checkbox to show profile in PMPro Directory, and add back the functionality only for administrators. | |
*/ | |
add_action( 'init', 'pmpromd_remove_profile_field_action' ); | |
function pmpromd_remove_profile_field_action() { | |
remove_action( 'show_user_profile', 'pmpromd_show_extra_profile_fields' ); | |
remove_action( 'edit_user_profile', 'pmpromd_show_extra_profile_fields' ); |
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 | |
/** | |
* Tell PMPro to look in the pages directory of this plugin for PMPro page templates. | |
* | |
* Add this code to your Customizations plugin. | |
* | |
* Make sure that there is a /paid-memberships-pro/pages/ directory in the plugin directory with your templates in it. | |
*/ | |
function my_pmpro_pages_custom_template_path( $default_templates ) { | |
$default_templates[] = dirname( __FILE__ ) . '/paid-memberships-pro/pages/checkout.php'; |
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
# BACKUP FIRST | |
# You generally do not want to setup PMPro levels | |
# with both a recurring billing amount AND | |
# an expiration date. | |
# This SQL query will clear the expiration date | |
# for active recurring memberships. | |
# BACKUP FIRST | |
UPDATE wp_pmpro_memberships_users | |
SET enddate = '0000-00-00 00:00:00' | |
WHERE status = 'active' |