Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/20/2014 09:02:33 PM (11 years ago)
Author:
boonebgorges
Message:

Introduce blog- and group-create button functions, and use to build directory headers in bp-legacy

The new functions bp_get_blog_create_button() and bp_get_group_create_button()
standardize the treatment of these buttons by using bp_get_button(). They also
make life easier for themers, who will not need to build the buttons from
scratch.

In this changeset we modify the way that bp-legacy loads these buttons into the
titles of the directory pages. Previously, it was done directly in BP's theme
compat layer, with the result that all template packs had to follow the
questionable practice of embedding a button inside of a header element. Now,
the directory title is a string, but is filtered; bp-legacy then chooses to
add a button by using the new create-button functions + the new filters.

Fixes #5144

Props hnla, r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-screens.php

    r7926 r7942  
    10221022    public function directory_dummy_post() {
    10231023
    1024         // Title based on ability to create groups
    1025         if ( is_user_logged_in() && bp_user_can_create_groups() ) {
    1026             $title = __( 'Groups', 'buddypress' ) . '&nbsp;<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ) . '">' . __( 'Create a Group', 'buddypress' ) . '</a>';
    1027         } else {
    1028             $title = __( 'Groups', 'buddypress' );
    1029         }
     1024        $title = apply_filters( 'bp_groups_directory_title', __( 'Groups', 'buddypress' ) );
    10301025
    10311026        bp_theme_compat_reset_post( array(
Note: See TracChangeset for help on using the changeset viewer.