Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/19/2016 07:35:41 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Statuses, Types, Visibilities: Pass the forum, topic, or reply ID into helper functions.

These ID's pass additional context into respective filters, useful for fine-grained control over UI elements.

This commit normalizes the way these functions work across all of bbPress where applicable, by ensuring all similar functions accept an ID and assume 0 by default. Note that there are currently 2 locations where no ID exists to pass context into, which is by design.

Fixes #2954.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r5969 r6026  
    16961696 * @since 2.6.0 bbPress (r5399)
    16971697 *
     1698 * @param int $reply_id   Optional. Reply id.
     1699 *
    16981700 * @return array
    16991701 */
    1700 function bbp_get_reply_statuses() {
     1702function bbp_get_reply_statuses( $reply_id = 0 ) {
    17011703    return apply_filters( 'bbp_get_reply_statuses', array(
    17021704        bbp_get_public_status_id()  => _x( 'Publish', 'Publish the reply',     'bbpress' ),
     
    17041706        bbp_get_trash_status_id()   => _x( 'Trash',   'Trash the reply',       'bbpress' ),
    17051707        bbp_get_pending_status_id() => _x( 'Pending', 'Mark reply as pending', 'bbpress' ),
    1706     ) );
     1708    ), $reply_id );
    17071709}
    17081710
Note: See TracChangeset for help on using the changeset viewer.