WordPress.org

Plugin Directory

Changeset 1415907


Ignore:
Timestamp:
05/12/16 20:46:50 (19 months ago)
Author:
Rimon_Habib
Message:

version 1.01, Minor release, Bug Fixes

Location:
bp-member-type-manager
Files:
23 added
4 edited

Legend:

Unmodified
Added
Removed
  • bp-member-type-manager/trunk/admin/screens/_settings.php

    r1406132 r1415907  
    5454                            If Enabled, Associated User role for each member type will work as alice.<br> 
    5555                            If Member type is changed, Role will be change too.<br> 
     56                            WordPress default user role will be overridden on new registration based on <br> 
     57                            new registered user member type and associated role of that member type .<br> 
     58 
     59                        </p> 
     60                    </div> 
     61<?php /* 
     62 
     63                    <div class="form-field form-required member-type-enable-directory-tab"> 
     64                        <label for="member-type-directory">Add member type tabs in member directory?</label> 
     65                        <select name="member-type-enable-directory-tab" id="member-type-enable-directory-tab" aria-required="false"> 
     66                            <option value="1" <?php echo !empty($bmtm_options['settings']["enable-directory-tab"]) ? ' selected ' : '' ?> >Enabled</option> 
     67                            <option value="0" <?php echo empty($bmtm_options['settings']["enable-directory-tab"]) ? ' selected ' : '' ?>>Disabled</option> 
     68                        </select> 
     69                        <p><br/></p> 
     70                        <p> 
     71                            If Enabled, In BuddyPress member directory page, separate tabs will be added for each member type<br> 
     72                            Separate member directory page will be created and linked at tabs for each member type.<br> 
    5673 
    5774                        </p> 
    5875                    </div> 
    5976 
     77*/ ?> 
    6078 
    6179                    <p class="submit"> 
    62                         <input type="submit" name="submit" id="submit" class="button button-primary" value="Update Member Type"> 
     80                        <input type="submit" name="submit" id="submit" class="button button-primary" value="Update Settings"> 
    6381                    </p> 
    6482 
  • bp-member-type-manager/trunk/bp-member-type-manager.php

    r1406132 r1415907  
    55 * Description: Create and Manage member types of your BuddyPress site. 
    66 * Author: Rimon Habib 
    7  * Version: 1.0 
     7 * Version: 1.01 
    88 * Author URI:  http://rimonhabib.com, 
    99 * License: GPLv2 or later 
  • bp-member-type-manager/trunk/includes/bp-member-type-manager-actions.php

    r1406132 r1415907  
    9595    $type_found = false; 
    9696    foreach( (array)$options['types'] as $type ){ 
     97        $default = !empty($type['is_default']) ? $type['slug'] : false; 
    9798        if( $type['slug'] === $requested_member_type ){ 
    9899            $type_found = $type['slug']; 
    99             $default = !empty($type['is_default']) ? $type['slug'] : false; 
    100100            $bmtm->requested_type = $type_found; 
    101101            break; 
     
    146146 
    147147    bmtm_update_member_type( $user_id, $bmtm->requested_type ); 
     148    update_user_meta( $user_id, 'member_type', $bmtm->requested_type  ); 
    148149 
    149150} 
    150151add_action('bp_core_signup_user','bmtm_assign_member_type_on_registration',10,1); 
     152 
     153 
     154 
     155function bmtm_assign_role_on_registration_activation( $user_id, $key, $user ){ 
     156    global $bmtm; 
     157    $options = $bmtm->get_options(); 
     158 
     159    if( empty($options['settings']['sync_user_role']) ) 
     160        return; 
     161 
     162    $member_type = get_user_meta( $user_id, 'member_type', true ); 
     163    $member = get_userdata( $user_id ); 
     164    $role = $options['types'][$member_type]['user_role']; 
     165    $member->set_role( $role ); 
     166} 
     167add_action('bp_core_activated_user','bmtm_assign_role_on_registration_activation', 10, 3); 
    151168 
    152169 
     
    201218                    echo '<div class="notice notice-success is-dismissible"><p>Member Type is deleted.</p></div>'; 
    202219                }); 
     220                wp_redirect(admin_url('admin.php?page=bmtm_manage_member_types')); 
    203221            } else 
    204222                add_action('admin_notices', function () { 
     
    215233        $separate_registration = !empty($_POST['member-type-separate-registration-page']) ? 1 : 0; 
    216234        $sync_user_role = !empty($_POST['member-type-user-role-sync']) ? 1 : 0; 
     235        $enable_directory_tab = !empty($_POST['member-type-enable-directory-tab']) ? 1 : 0; 
    217236 
    218237        $options['settings']['separate_registration'] = $separate_registration; 
    219238        $options['settings']['sync_user_role'] = $sync_user_role; 
     239        $options['settings']['enable-directory-tab'] = $enable_directory_tab; 
    220240        $bmtm->save_options( $options ); 
    221241        } 
  • bp-member-type-manager/trunk/readme.txt

    r1406132 r1415907  
    44Tags: BuddyPress,Member Type,BuddyPress Member Types 
    55Requires at least: 4.2 
    6 Tested up to: 4.5.1 
    7 Stable tag: 4.5.1 
     6Tested up to: 4.5 
     7Stable tag: 4.5 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    4646== Screenshots == 
    4747 
    48 1. Member Type Manage Screen 1 
    49 2. Member Type Manage Screen 2 
    50 3. Settings Screen 1 
    51 4. Settings Screen 2 
     481. Settings Screen 
     492. Member Type Manage Screen 
    5250 
    5351== Changelog == 
     
    5654* Initial Release 
    5755 
     56= 1.01 = 
     57* User role sync bug fix 
     58* misc bug fixes 
     59 
    5860== Upgrade Notice == 
    5961 
    6062= 1.0 = 
    6163* Initial Release, Try it out first! 
     64 
     65= 1.01 = 
     66* User role sync bug fix 
     67* misc bug fixes 
Note: See TracChangeset for help on using the changeset viewer.