Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/20/2015 01:23:47 PM (10 years ago)
Author:
boonebgorges
Message:

Improve the flexibility of the separators in the action links of the groups and members widgets.

  • Introduce filters 'bp_groups_widget_separator' and 'bp_members_widget_separator' to allow customization of the default pipe character.
  • Wrap separators in a <span> element, to allow for custom styling and proper ARIA role.

Props dunhakdis, pareshradadiya, hnla.
Fixes #6513.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-widgets.php

    r9819 r9955  
    7373        $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    7474
     75        /**
     76         * Filters the separator of the group widget links.
     77         *
     78         * @since BuddyPress (2.4.0)
     79         *
     80         * @param string $separator Separator string. Default '|'.
     81         */
     82        $separator = apply_filters( 'bp_groups_widget_separator', '|' );
     83
    7584        echo $before_widget;
    7685
     
    9099        <?php if ( bp_has_groups( $group_args ) ) : ?>
    91100            <div class="item-options" id="groups-list-options">
    92                 <a href="<?php bp_groups_directory_permalink(); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> |
    93                 <a href="<?php bp_groups_directory_permalink(); ?>" id="recently-active-groups"<?php if ( $instance['group_default'] == 'active' ) : ?> class="selected"<?php endif; ?>><?php _e("Active", 'buddypress') ?></a> |
     101                <a href="<?php bp_groups_directory_permalink(); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a>
     102                <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span>
     103                <a href="<?php bp_groups_directory_permalink(); ?>" id="recently-active-groups"<?php if ( $instance['group_default'] == 'active' ) : ?> class="selected"<?php endif; ?>><?php _e("Active", 'buddypress') ?></a>
     104                <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span>
    94105                <a href="<?php bp_groups_directory_permalink(); ?>" id="popular-groups" <?php if ( $instance['group_default'] == 'popular' ) : ?> class="selected"<?php endif; ?>><?php _e("Popular", 'buddypress') ?></a>
    95106            </div>
Note: See TracChangeset for help on using the changeset viewer.