Skip to content

Commit

Permalink
Bring back a weird approvals.php missing file
Browse files Browse the repository at this point in the history
* Just bringing back some missing files from SVN for Approvals.
  • Loading branch information
andrewlimaza committed May 9, 2023
1 parent 6cfa2e1 commit 8515fd1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
23 changes: 23 additions & 0 deletions includes/approvals.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* PMPro Approvals support.
*/

/**
* Reset groups and member types when a user is approved.
*/
function pmpro_bp_pmpro_approvals_after_approve_member( $user_id, $level_id ) {
pmpro_bp_set_member_groups( $level_id, $user_id, NULL );
pmpro_bp_set_member_types( $level_id, $user_id, NULL );
}
add_action( 'pmpro_approvals_after_approve_member', 'pmpro_bp_pmpro_approvals_after_approve_member', 10, 2 );

/**
* Reset groups and member types when a user is denied or reset.
*/
function pmpro_bp_pmpro_approvals_after_deny_member( $user_id, $level_id ) {
pmpro_bp_set_member_groups( $level_id, $user_id, $level_id );
pmpro_bp_set_member_types( $level_id, $user_id, $level_id );
}
add_action( 'pmpro_approvals_after_deny_member', 'pmpro_bp_pmpro_approvals_after_deny_member', 10, 2 );
add_action( 'pmpro_approvals_after_reset_member', 'pmpro_bp_pmpro_approvals_after_deny_member', 10, 2 );
4 changes: 4 additions & 0 deletions pmpro-buddypress.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ function pmpro_bp_load_plugin_text_domain() {
require_once( PMPROBP_DIR . '/includes/profiles.php' );
require_once( PMPROBP_DIR . '/includes/registration.php' );
require_once( PMPROBP_DIR . '/includes/restrictions.php' );

if ( class_exists( 'PMPro_Approvals' ) ) {
require_once( PMPROBP_DIR . '/includes/approvals.php' );
}
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: community, private community, paid memberships pro, buddypress, buddyboss,
Requires at least: 5.2
Tested up to: 6.2
Requires PHP: 7.0
Stable tag: 1.4
Stable tag: 1.4.1

Restrict access to communities in BuddyPress & BuddyBoss for free or premium members with the top WordPress membership plugin Paid Memberships Pro

Expand Down

0 comments on commit 8515fd1

Please sign in to comment.