WordPress.org

Plugin Directory

Changeset 1307565


Ignore:
Timestamp:
12/13/15 21:11:14 (16 months ago)
Author:
hardlyneutral
Message:
  • Tested plugin as functional with WordPress 4.4 and BuddyPress 2.4.2
  • Fixed a bug where list bullets would show up in some themes
  • Added the ability to switch between a list of checkboxes and a list of checkboxes in a scrollable container
Location:
buddypress-registration-groups-1/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • buddypress-registration-groups-1/trunk/includes/bp-registration-groups.php

    r1138548 r1307565  
    99    wp_register_style( 'bp_registration_groups_styles', plugins_url('/styles.css', __FILE__) ); 
    1010    wp_enqueue_style( 'bp_registration_groups_styles' ); 
     11 
     12    //wp_register_script('bp_registration_groups_scripts', plugins_url('scripts.js', __FILE__), array('jquery'), '', true); 
    1113} 
    1214 
     
    3941    $bp_registration_groups_display_order = ( isset( $bp_registration_groups_options['bp_registration_groups_display_order'] ) && in_array($bp_registration_groups_options['bp_registration_groups_display_order'], $bp_registration_groups_display_order_options, true) ) ? $bp_registration_groups_options['bp_registration_groups_display_order'] : 'alphabetical'; 
    4042 
     43    // set $bp_registration_groups_display_as to 'reg_groups_list_multiselect' if the stored value is 2; set to 'reg_groups_list' otherwise 
     44    $bp_registration_groups_display_as = ( isset( $bp_registration_groups_options['bp_registration_groups_display_as'] ) && $bp_registration_groups_options['bp_registration_groups_display_as'] != '1' ) ? 'reg_groups_list_multiselect' : 'reg_groups_list'; 
     45 
    4146    // set $bp_registration_groups_show_private_groups to array( 'public', 'private' ) if the stored option is "1" or array( 'public', 'private' ) otherwise 
    4247    $bp_registration_groups_show_private_groups = ( !isset($bp_registration_groups_options['bp_registration_groups_show_private_groups']) || $bp_registration_groups_options['bp_registration_groups_show_private_groups'] != '1' ) ? array( 'public' ) : array ( 'public', 'private' ); 
     
    4954            <h4 class="reg_groups_title"><?php _e( $bp_registration_groups_title, 'buddypress-registration-groups-1' ); ?></h3> 
    5055            <p class="reg_groups_description"><?php _e( $bp_registration_groups_description.':', 'buddypress-registration-groups-1' ); ?></p> 
    51             <ul class="reg_groups_list"> 
     56            <ul class="<?php _e( $bp_registration_groups_display_as, 'buddypress-registration-groups-1' ); ?>"> 
    5257                <?php $i = 0; $l = 0; ?> 
    5358                <?php if ( bp_has_groups('type='.$bp_registration_groups_display_order.'&per_page='.groups_get_total_group_count() ) ) : while ( bp_groups() && $l < $bp_registration_groups_number_displayed ) : bp_the_group(); ?> 
     
    235240        ); 
    236241 
     242                add_settings_field( 
     243                        'bp_registration_groups_display_as', 
     244                        'Display As', 
     245                        array( $this, 'bp_registration_groups_display_as_callback' ), 
     246                        'bp-registration-groups-settings-admin', 
     247                        'bp_registration_groups_display_options_section_id' 
     248                ); 
     249 
    237250        add_settings_field( 
    238251            'bp_registration_groups_show_private_groups', 
     
    269282            $new_input['bp_registration_groups_display_order'] = sanitize_text_field( $input['bp_registration_groups_display_order'] ); 
    270283 
     284                if( isset( $input['bp_registration_groups_display_as'] ) ) 
     285            $new_input['bp_registration_groups_display_as'] = absint( $input['bp_registration_groups_display_as'] ); 
     286 
    271287        if( isset( $input['bp_registration_groups_show_private_groups'] ) ) 
    272288            $new_input['bp_registration_groups_show_private_groups'] = absint( $input['bp_registration_groups_show_private_groups'] ); 
     
    365381    } 
    366382 
     383        /** 
     384     * Get the settings option array and print one of its values 
     385     */ 
     386    public function bp_registration_groups_display_as_callback() 
     387    { 
     388        printf( 
     389            '<input type="radio" %s name="bp_registration_groups_option_handle[bp_registration_groups_display_as]" value="1"> Checkboxes (default)', 
     390            !isset($this->options['bp_registration_groups_display_as_checkboxes']) || isset($this->options['bp_registration_groups_display_as']) && $this->options['bp_registration_groups_display_as'] == '1' ? 'checked="checked"' : '' 
     391        ); 
     392 
     393        _e( '<br />' ); 
     394 
     395        printf( 
     396            '<input type="radio" %s name="bp_registration_groups_option_handle[bp_registration_groups_display_as]" value="2"> Multiselect', 
     397            isset($this->options['bp_registration_groups_display_as']) && $this->options['bp_registration_groups_display_as'] == '2' ? 'checked="checked"' : '' 
     398        ); 
     399    } 
     400 
    367401    /** 
    368402     * Get the settings option array and print one of its values 
  • buddypress-registration-groups-1/trunk/includes/styles.css

    r1138548 r1307565  
     1/** 
     2* plugin styles 
     3*/ 
     4 
    15#registration-groups-section { 
    26    float: right; 
     
    2125} 
    2226 
     27.reg_groups_item { 
     28    list-style: none; 
     29} 
     30 
    2331.reg_groups_none { 
    2432    font-style: italic; 
    2533    color: gray; 
    2634} 
     35 
     36/** 
     37 * Styling the for the 'multiselect' version of the 
     38 * checkboxes. Matches the default BuddyPress form fields 
     39 * look. Override to match your theme. 
     40 */ 
     41.reg_groups_list_multiselect { 
     42    height: 8em; 
     43        border: 1px solid #ccc; 
     44        background: #fafafa; 
     45        padding: 6px; 
     46    overflow: auto; 
     47} 
  • buddypress-registration-groups-1/trunk/loader.php

    r1180401 r1307565  
    55Plugin URI: https://wordpress.org/plugins/buddypress-registration-groups-1/ 
    66Description: Allows a new BuddyPress user to select groups to join during the registration process. 
    7 Version: 1.0.3 
     7Version: 1.1.0 
    88Tags: wordpress, multisite, buddypress, groups, registration, autojoin 
    99Requires at least: WordPress 3.7.1 / BuddyPress 1.8.1 
    10 Tested up to: WordPress 4.2.2 / BuddyPress 2.3.1 
     10Tested up to: WordPress 4.4 / BuddyPress 2.4.2 
    1111License: GNU/GPL 2 
    1212Author: Eric Johnson 
     
    1919 
    2020// Define a constant that will hold the current version number of the component 
    21 define( 'BP_REGISTRATION_GROUPS_VERSION', '1.0.3' ); 
     21define( 'BP_REGISTRATION_GROUPS_VERSION', '1.1.0' ); 
    2222 
    2323// Define a constant that we can use to construct file paths throughout the component 
  • buddypress-registration-groups-1/trunk/readme.txt

    r1180401 r1307565  
    11=== BuddyPress Registration Groups === 
    22Plugin URI: https://wordpress.org/plugins/buddypress-registration-groups-1/ 
    3 Version: 1.0.3 
     3Version: 1.1.0 
    44Tags: wordpress, multisite, buddypress, groups, registration, autojoin 
    55Requires at least: WordPress 3.7.1 / BuddyPress 1.8.1 
    6 Tested up to: WordPress 4.2.2 / BuddyPress 2.3.1 
     6Tested up to: WordPress 4.4 / BuddyPress 2.4.2 
    77License: GNU/GPL 2 
    88Author: Eric Johnson 
     
    5151 
    5252== Changelog == 
     53 
     54= 1.1.0 = 
     55* Tested plugin as functional with WordPress 4.4 and BuddyPress 2.4.2 
     56* Fixed a bug where list bullets would show up in some themes 
     57* Added the ability to switch between a list of checkboxes and a list of checkboxes in a scrollable container 
    5358 
    5459= 1.0.3 = 
     
    124129== Upgrade Notice == 
    125130 
     131= 1.1.0 = 
     132* Tested plugin as functional with WordPress 4.4 and BuddyPress 2.4.2. Safe to upgrade. 
     133 
    126134= 1.0.3 = 
    127135* Tested plugin as functional with WordPress 4.2.2 and BuddyPress 2.3.1. Safe to upgrade. 
Note: See TracChangeset for help on using the changeset viewer.