Skip to:
Content

Changeset 6534


Ignore:
Timestamp:
11/23/12 02:32:27 (17 months ago)
Author:
r-a-y
Message:

Fix bp_get_group_new_topic_button() so the filter works properly.

Previously, bp_button() was being used in the function, which outputted the
button instead of returning it.

This prevented the 'bp_get_group_new_topic_button' filter from working
as intended.

Also, add phpDoc to the function.

File:
1 edited

Legend:

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

    r6507 r6534  
    15711571} 
    15721572 
     1573/** 
     1574 * Outputs a 'New Topic' button for a group. 
     1575 * 
     1576 * @since BuddyPress (1.2.7) 
     1577 * 
     1578 * @param obj|bool $group The BP Groups_Group object if passed, boolean false if not passed. 
     1579 * @uses bp_get_group_new_topic_button() Returns the 'New Topic' button 
     1580 */ 
    15731581function bp_group_new_topic_button( $group = false ) { 
    15741582    echo bp_get_group_new_topic_button( $group ); 
    15751583} 
     1584    /** 
     1585     * Returns a 'New Topic' button for a group. 
     1586     * 
     1587     * @since BuddyPress (1.2.7) 
     1588     * 
     1589     * @param obj|bool $group The BP Groups_Group object if passed, boolean false if not passed. 
     1590     * @uses is_user_logged_in() Is there a user logged in? 
     1591     * @uses bp_group_is_user_banned() Is the current user banned from the current group? 
     1592     * @uses bp_is_group_forum() Are we on a group forum page? 
     1593     * @uses bp_is_group_forum_topic() Are we on a group topic page? 
     1594     * @uses bp_get_button() Renders a button 
     1595     * @return HTML code for the button 
     1596     */ 
    15761597    function bp_get_group_new_topic_button( $group = false ) { 
    15771598        global $groups_template; 
     
    15831604            return false; 
    15841605 
    1585         $button = bp_button( array ( 
     1606        $button = array( 
    15861607            'id'                => 'new_topic', 
    15871608            'component'         => 'groups', 
     
    15941615            'link_text'         => __( 'New Topic', 'buddypress' ), 
    15951616            'link_title'        => __( 'New Topic', 'buddypress' ), 
    1596         ) ); 
     1617        ); 
    15971618 
    15981619        // Filter and return the HTML button 
Note: See TracChangeset for help on using the changeset viewer.