#2954 closed enhancement (fixed)
function bbp_get_topic_statuses misuse in topics/template.php or bad function declaration in topics/functions.php
Reported by: | jyd44 | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | 2.0 |
Component: | Component - Any/All | Keywords: | |
Cc: |
Description (last modified by )
In the file topics/template.php, the function bbp_get_topic_statuses is called with one parameter (the id of the topic:)
<?php foreach ( bbp_get_topic_statuses( $r['topic_id'] ) as $key => $label ) :
.
Unfortunately, the declaration and the definition of this function in the file topics/functions.php does not mention this parameter.
<?php function bbp_get_topic_statuses() { return apply_filters( 'bbp_get_topic_statuses', array( bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ), bbp_get_closed_status_id() => _x( 'Closed', 'Close the topic', 'bbpress' ), bbp_get_spam_status_id() => _x( 'Spam', 'Spam the topic', 'bbpress' ), bbp_get_trash_status_id() => _x( 'Trash', 'Trash the topic', 'bbpress' ), bbp_get_pending_status_id() => _x( 'Pending', 'Mark topic as pending', 'bbpress' ), ) ); }
Adding the topic_id as a parameter to the function and to the call to apply_filters would give the opportunity to filter the available topic statuses when creating a topic (I do not see any good reason to set the status to trash or spam when creating a ticket).
Change History (4)
Note: See
TracTickets for help on using
tickets.
In 6026: