Skip to content

Commit

Permalink
Dev - Added support for membership tab in URCMA
Browse files Browse the repository at this point in the history
  • Loading branch information
iamprazol committed Jan 8, 2025
1 parent b176f8b commit 163f34a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
* Fix - Email Preview issue on Verified email.
* Fix - Slug translation issue on my account links.
* Fix - Username accepting some special characters.
* Fix - Profile detail update being triggered twice.
* Fix - Login preview styles not loaded in customizer.
* Fix - Latest release design issue in dashboard page.
* Fix - Status changed to pending mail on registration.
* Fix - Error handling when wp_insert_user throws error.
* Fix - Unknown email updated message not being displayed.
* Fix - Show invalid user/email message form message options.

= 3.3.5.2 - 21/11/2024 =
Expand Down
17 changes: 6 additions & 11 deletions modules/membership/includes/Frontend/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Frontend {
*/
public function __construct() {
$this->init_hooks();

}

/**
Expand All @@ -39,7 +38,7 @@ private function init_hooks() {
add_filter( 'user_registration_account_menu_items', array( $this, 'ur_membership_tab' ), 10, 1 );

add_action(
'user_registration_account_membership_endpoint',
'user_registration_account_ur-membership_endpoint',
array(
$this,
'user_registration_membership_tab_endpoint_content',
Expand All @@ -59,9 +58,9 @@ public function ur_membership_tab( $items ) {
if ( 'membership' !== $user_source ) {
return $items;
}
$new_items = array();
$new_items['membership'] = __( 'Membership', 'user-registration' );
$items = array_merge( $items, $new_items );
$new_items = array();
$new_items['ur-membership'] = __( 'Membership', 'user-registration' );
$items = array_merge( $items, $new_items );

return $this->delete_account_insert_before_helper( $items, $new_items, 'user-logout' );
}
Expand All @@ -79,7 +78,7 @@ public function delete_account_insert_before_helper( $items, $new_items, $before
$position = array_search( $before, array_keys( $items ), true );

// Insert the new item.
$return_items = array_slice( $items, 0, $position, true );
$return_items = array_slice( $items, 0, $position, true );
$return_items += $new_items;
$return_items += array_slice( $items, $position, count( $items ) - $position, true );

Expand All @@ -103,7 +102,6 @@ public function user_registration_membership_tab_endpoint_content() {
'membership' => $membership,
)
);

}

/**
Expand All @@ -119,7 +117,7 @@ public function ur_add_membership_tab_endpoint() {
}
$mask = Ur()->query->get_endpoints_mask();

add_rewrite_endpoint( 'membership', $mask );
add_rewrite_endpoint( 'ur-membership', $mask );
flush_rewrite_rules();
}

Expand All @@ -141,7 +139,6 @@ public function load_scripts() {

wp_enqueue_script( 'user-registration-membership-stripe-v3', 'https://js.stripe.com/v3/', array() );


$this->localize_scripts();
}

Expand Down Expand Up @@ -217,6 +214,4 @@ public function get_i18_labels() {
'i18n_sending_text' => __( 'Sending ...', 'user-registration' ),
);
}


}
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
* Fix - Username accepting some special characters.
* Fix - Profile detail update being triggered twice.
* Fix - Login preview styles not loaded in customizer.
* Fix - Latest release design issue in dashboard page.
* Fix - Status changed to pending mail on registration.
* Fix - Error handling when wp_insert_user throws error.
* Fix - Unknown email updated message not being displayed.
* Fix - Show invalid user/email message form message options.

= 3.3.5.2 - 21/11/2024 =
Expand Down

0 comments on commit 163f34a

Please sign in to comment.