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 | |
/** | |
* Show the pmpro_account shortcode on the WooCommmerce My Account page for members | |
* who have a history of membership through Paid Memberships Pro. | |
*/ | |
function pmpro_do_membership_account_shortcode() { | |
global $wpdb, $current_user; | |
if( is_user_logged_in() && defined( 'PMPRO_VERSION' ) ) { ?> | |
<style> .pmpro_actionlinks {display: none; } </style> | |
<?php |
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 | |
/** | |
* Get the next payment date for a user's level inclusive of subscriptions and expiration dates. | |
* | |
* If the current user has a subscription for a passed level ID, return the next payment date for that subscription. | |
* Otherwise, if the user has an expiration date set for the level, return that. | |
* Otherwise, return null. | |
* | |
* @param int $level_id The level ID to check for. | |
* @return int|null The next payment date/expiration date as a timestamp or null. |
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 | |
/** | |
* Ensure Paid Memberships Pro compatibility when using the Elementor Page Builder: | |
* https://wordpress.org/plugins/elementor/ | |
* | |
* Your administrator-level account must have a Membership Level in order to edit all of the pages assigned | |
* under Memberships > Pages. | |
* | |
* You must also set a Custom Field on the Membership Checkout page with the key 'pmpro_default_level' and | |
* value of a level ID in order to properly edit your Membership Checkout page using Elementor. |
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 | |
/** | |
* Filter the settings of email frequency sent when using the Extra Expiration Warning Emails Add On | |
* https://www.paidmembershipspro.com/add-ons/extra-expiration-warning-emails-add-on/ | |
* | |
* Update the $settings array to your list of number of days => ''. | |
* Read the Add On documentation for additional customization using this filter. | |
*/ | |
function custom_pmproeewe_email_frequency( $settings = array() ) { |
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 | |
/** | |
* Enqueue your theme or child theme's version of the legacy frontend.css file. | |
* Note: PMPro v3.1+ css selectors have been overhauled and many of the legacy class names are no longer supported. | |
*/ | |
function my_pmpro_enqueue_theme_frontend_css() { | |
if ( is_admin() ) { | |
return; | |
} |
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 | |
/** | |
* Redirect the main user page parent to a custom page. | |
*/ | |
function my_pmproup_wp_parent_page_redirect() { | |
global $wpdb, $post, $current_user; | |
// Return early if the User Pages Add On is not active. | |
if ( ! function_exists( 'pmproup_getOptions' ) ) { | |
return; |
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 | |
function my_coa_demo_pmpro_gettext_changes( $translated_text, $text, $domain ) { | |
if ( $domain == 'pmpro-shipping' ) { | |
if ( $text == 'Shipping Address' ) { | |
$translated_text = 'Mailing Address'; | |
} | |
} | |
return $translated_text; | |
} |
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 | |
/** | |
* Shortcode to display a table of units, owners, and residents. | |
*/ | |
function condo_units_table_shortcode( $atts ) { | |
global $wpdb; | |
// Shortcode attributes with defaults | |
$atts = shortcode_atts( array( | |
'meta_key' => 'unit', // The usermeta key to retrieve unit numbers |
NewerOlder