Skip to content

Commit 6dca2cb

Browse files
committed
Fixed pmpro_getAddonBySlug compat with update manager
1 parent 39b89dc commit 6dca2cb

5 files changed

Lines changed: 22 additions & 14 deletions

File tree

CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
== Changelog ==
2+
= 3.4.6 - 2025-04-21 =
3+
* BUG FIX: Fixed fatal error related to redefining `pmpro_getAddonBySlug` when activating PMPro Core with the PMPro Update Manager active. (@ideadude)
4+
25
= 3.4.5 - 2025-04-21 =
36
* ENHANCEMENT: Now including First Name and Last Name in Zapier trigger data. #3356 (@dwanjuki)
47
* ENHANCEMENT: Adjusting categories for the Add Ons page and fixing hub links. #3371 (@kimcoleman)

includes/addons.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,22 @@ function pmpro_get_add_ons_with_incorrect_folder_names() {
129129
* @param object $slug The identifying slug for the addon (typically the directory name)
130130
* @return object $addon containing plugin information or false if not found
131131
*/
132-
function pmpro_getAddonBySlug( $slug ) {
133-
$addons = pmpro_getAddons();
132+
if ( ! function_exists( 'pmpro_getAddonBySlug' ) ) {
133+
function pmpro_getAddonBySlug( $slug ) {
134+
$addons = pmpro_getAddons();
134135

135-
if ( empty( $addons ) ) {
136-
return false;
137-
}
136+
if ( empty( $addons ) ) {
137+
return false;
138+
}
138139

139-
foreach ( $addons as $addon ) {
140-
if ( $addon['Slug'] == $slug ) {
141-
return $addon;
140+
foreach ( $addons as $addon ) {
141+
if ( $addon['Slug'] == $slug ) {
142+
return $addon;
143+
}
142144
}
143-
}
144145

145-
return false;
146+
return false;
147+
}
146148
}
147149

148150
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "paid-memberships-pro",
3-
"version": "3.4.5",
3+
"version": "3.4.6",
44
"description": "WordPress Membership Plugin",
55
"directories": {
66
"test": "tests"

paid-memberships-pro.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Paid Memberships Pro
44
* Plugin URI: https://www.paidmembershipspro.com
55
* Description: The Trusted Membership Platform That Grows with You
6-
* Version: 3.4.5
6+
* Version: 3.4.6
77
* Author: Paid Memberships Pro
88
* Author URI: https://www.paidmembershipspro.com
99
* Text Domain: paid-memberships-pro
@@ -16,7 +16,7 @@
1616
*/
1717

1818
// version constant
19-
define( 'PMPRO_VERSION', '3.4.5' );
19+
define( 'PMPRO_VERSION', '3.4.6' );
2020
define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
2121
define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
2222

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: memberships, member, community, user profile, user registration
44
Requires at least: 5.2
55
Tested up to: 6.8
66
Requires PHP: 5.6
7-
Stable tag: 3.4.5
7+
Stable tag: 3.4.6
88
License: GPLv2
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -204,6 +204,9 @@ Not sure? You can find out by doing a bit a research.
204204
4. [Ask using our contact form](https://www.paidmembershipspro.com/contact/)
205205

206206
== Changelog ==
207+
= 3.4.6 - 2025-04-21 =
208+
* BUG FIX: Fixed fatal error related to redefining `pmpro_getAddonBySlug` when activating PMPro Core with the PMPro Update Manager active. (@ideadude)
209+
207210
= 3.4.5 - 2025-04-21 =
208211
* ENHANCEMENT: Now including First Name and Last Name in Zapier trigger data. #3356 (@dwanjuki)
209212
* ENHANCEMENT: Adjusting categories for the Add Ons page and fixing hub links. #3371 (@kimcoleman)

0 commit comments

Comments
 (0)