Skip to content

Commit

Permalink
Merge branch 'dev' into v2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed May 7, 2020
2 parents 7455caa + 6cb58d1 commit 3642a19
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 3 additions & 4 deletions adminpages/advancedsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,11 @@
<tr id="hideads_explanation" <?php if($hideads < 2) { ?>style="display: none;"<?php } ?>>
<th scope="row" valign="top">&nbsp;</th>
<td>
<p><?php _e('Ads from the following plugins will be automatically turned off', 'paid-memberships-pro' );?>: <em>Easy Adsense</em>, ...</p>
<p><?php _e('To hide ads in your template code, use code like the following', 'paid-memberships-pro' );?>:</p>
<pre lang="PHP">
if ( pmpro_displayAds() ) {
//insert ad code here
}</pre>
if ( function_exists( 'pmpro_displayAds' ) && pmpro_displayAds() ) {
//insert ad code here
}</pre>
</td>
</tr>
<tr id="hideadslevels_tr" <?php if($hideads != 2) { ?>style="display: none;"<?php } ?>>
Expand Down
8 changes: 6 additions & 2 deletions classes/class-pmpro-admin-activity-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down Expand Up @@ -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;
Expand Down
17 changes: 12 additions & 5 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions includes/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions paid-memberships-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' );

Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shortcodes/pmpro_account.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function pmpro_shortcode_account($atts, $content=null, $code="")
$pmpro_profile_action_links['change-password'] = sprintf( '<a id="pmpro_actionlink-change-password" href="%s">%s</a>', esc_url( $change_password_url ), esc_html__( 'Change Password', 'paid-memberships-pro' ) );
$pmpro_profile_action_links['logout'] = sprintf( '<a id="pmpro_actionlink-logout" href="%s">%s</a>', 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 (
Expand Down

0 comments on commit 3642a19

Please sign in to comment.