diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7cbe48283..2a27ea1dd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,10 @@ == Changelog == += 2.3.2 2020-05-07 = +* BUG FIX: Fixed errors calling is_main_query() that came up with certain themes. +* BUG FIX: Fixed typo in the pmpro_account_profile_action_links filter. +* BUG FIX/ENHANCEMENT: Added a new force parameter to the pmpro_getAllLevels() function. This is used by the Multisite Membership Add On to fix an issue where levels were missing or incorrect on the subsites. +* ENHANCEMENT: Removed mention of the ezAdsense plugin, which has been discontinued. + = 2.3.1 2020-05-01 = * BUG FIX: Fixed infinite redirect issue if no account page was set. Fixed a few other places where we do is_page() type checks just in case. * BUG FIX: Fixed issue where all pages were retitled to Welcome when logged in, if no login page was set. diff --git a/adminpages/advancedsettings.php b/adminpages/advancedsettings.php index ecc1ab511..dad5d53c2 100644 --- a/adminpages/advancedsettings.php +++ b/adminpages/advancedsettings.php @@ -341,12 +341,11 @@ style="display: none;">   -

: Easy Adsense, ...

:

-	if ( pmpro_displayAds() ) {
-		//insert ad code here
-	}
+if ( function_exists( 'pmpro_displayAds' ) && pmpro_displayAds() ) { + //insert ad code here +} style="display: none;"> diff --git a/classes/class-pmpro-admin-activity-email.php b/classes/class-pmpro-admin-activity-email.php index a7e9a6f9f..606f091a8 100644 --- a/classes/class-pmpro-admin-activity-email.php +++ b/classes/class-pmpro-admin-activity-email.php @@ -24,7 +24,7 @@ public static function get_instance() { * * @param string $frequency to send emails at. Determines length of time reported. */ - public function sendAdminActivity( $frequency = '' ) { + public function sendAdminActivity( $frequency = '', $recipient = null ) { global $wpdb, $pmpro_levels; if ( ! in_array( $frequency, array( 'day', 'week', 'month', 'never' ), true ) ) { @@ -400,7 +400,11 @@ public function sendAdminActivity( $frequency = '' ) { $admin_activity_email_body .= $content; } - $this->email = get_bloginfo( 'admin_email' ); + if ( empty( $recipient ) ) { + $recipient = get_bloginfo( 'admin_email' ); + } + $this->email = $recipient; + $this->subject = sprintf( __( '[%1$s] Paid Memberships Pro Activity for %2$s: %3$s', 'paid-memberships-pro' ), get_bloginfo( 'name' ), ucwords( $term ), $date_range ); $this->template = 'admin_activity_email'; $this->body = $admin_activity_email_body; diff --git a/includes/functions.php b/includes/functions.php index edc9d6900..5cf2e3d2b 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -2047,20 +2047,27 @@ function pmpro_getLevel( $level ) { Get all PMPro membership levels. @param bool $include_hidden Include levels marked as hidden/inactive. - @param bool $force If false, use $pmpro_levels global. If true use other caches. + @param bool $use_cache If false, use $pmpro_levels global. If true use other caches. + @param bool $force Resets the static var caches as well. */ -function pmpro_getAllLevels( $include_hidden = false, $force = false ) { +function pmpro_getAllLevels( $include_hidden = false, $use_cache = false, $force = false ) { global $pmpro_levels, $wpdb; static $pmpro_all_levels; // every single level static $pmpro_visible_levels; // every single level that's not hidden + if ( $force ) { + $pmpro_levels = NULL; + $pmpro_all_levels = NULL; + $pmpro_visible_levels = NULL; + } + // just use the $pmpro_levels global - if ( ! empty( $pmpro_levels ) && ! $force ) { - return $pmpro_levels; + if ( ! empty( $pmpro_levels ) && ! $use_cache ) { + return $pmpro_levels; } - // For now, if force is true, still check if we have something in a static var. + // If use_cache is true check if we have something in a static var. if ( $include_hidden && isset( $pmpro_all_levels ) ) { return $pmpro_all_levels; } diff --git a/includes/login.php b/includes/login.php index 71db4234f..d6636f86e 100644 --- a/includes/login.php +++ b/includes/login.php @@ -197,13 +197,13 @@ function pmpro_login_form_hidden_field( $html ) { * @since 2.3 */ function pmpro_login_the_title( $title, $id = NULL ) { - global $pmpro_pages; + global $pmpro_pages, $wp_query; if ( is_admin() ) { return $title; } - - if ( ! is_main_query() || ! is_page( $id ) ) { + + if ( isset( $wp_query ) && ( ! is_main_query() || ! is_page( $id ) ) ) { return $title; } diff --git a/paid-memberships-pro.php b/paid-memberships-pro.php index 63c3a3c95..7ac5033e3 100644 --- a/paid-memberships-pro.php +++ b/paid-memberships-pro.php @@ -3,7 +3,7 @@ * Plugin Name: Paid Memberships Pro * Plugin URI: https://www.paidmembershipspro.com * Description: The most complete member management and membership subscriptions plugin for WordPress. - * Version: 2.3.1 + * Version: 2.3.2 * Author: Stranger Studios * Author URI: https://www.strangerstudios.com * Text Domain: paid-memberships-pro @@ -16,7 +16,7 @@ */ // version constant -define( 'PMPRO_VERSION', '2.3.1' ); +define( 'PMPRO_VERSION', '2.3.2' ); define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() ); define( 'PMPRO_MIN_PHP_VERSION', '5.6' ); diff --git a/readme.txt b/readme.txt index 04c0bf89c..9a82f9513 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: strangerstudios, kimannwall, andrewza, dlparker1005 Tags: memberships, members, subscriptions, ecommerce, user registration, member, membership, e-commerce, paypal, stripe, braintree, authorize.net, payflow, restrict access, restrict content, directory Requires at least: 4 Tested up to: 5.4.1 -Stable tag: 2.3.1 +Stable tag: 2.3.2 Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site. @@ -153,6 +153,12 @@ Not sure? You can find out by doing a bit a research. 8. Membership Account page, display all sections or show specific sections using shortcode attributes. == Changelog == += 2.3.2 2020-05-07 = +* BUG FIX: Fixed errors calling is_main_query() that came up with certain themes. +* BUG FIX: Fixed typo in the pmpro_account_profile_action_links filter. +* BUG FIX/ENHANCEMENT: Added a new force parameter to the pmpro_getAllLevels() function. This is used by the Multisite Membership Add On to fix an issue where levels were missing or incorrect on the subsites. +* ENHANCEMENT: Removed mention of the ezAdsense plugin, which has been discontinued. + = 2.3.1 2020-05-01 = * BUG FIX: Fixed infinite redirect issue if no account page was set. Fixed a few other places where we do is_page() type checks just in case. * BUG FIX: Fixed issue where all pages were retitled to Welcome when logged in, if no login page was set. diff --git a/shortcodes/pmpro_account.php b/shortcodes/pmpro_account.php index 28287862c..0e5b8173d 100644 --- a/shortcodes/pmpro_account.php +++ b/shortcodes/pmpro_account.php @@ -177,7 +177,7 @@ function pmpro_shortcode_account($atts, $content=null, $code="") $pmpro_profile_action_links['change-password'] = sprintf( '%s', esc_url( $change_password_url ), esc_html__( 'Change Password', 'paid-memberships-pro' ) ); $pmpro_profile_action_links['logout'] = sprintf( '%s', esc_url( wp_logout_url() ), esc_html__( 'Log Out', 'paid-memberships-pro' ) ); - $pmpro_profile_action_links = apply_filters( 'pmpro_account_profile_actionlinks', $pmpro_profile_action_links ); + $pmpro_profile_action_links = apply_filters( 'pmpro_account_profile_action_links', $pmpro_profile_action_links ); $allowed_html = array( 'a' => array (