Changeset 6026 for trunk/src/includes/topics/functions.php
- Timestamp:
- 05/19/2016 07:35:41 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r5969 r6026 284 284 /** Topic Status **********************************************************/ 285 285 286 // Get available topic statuses 287 $topic_statuses = bbp_get_topic_statuses(); 288 286 289 // Maybe put into moderation 287 290 if ( ! bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) { … … 289 292 290 293 // Check a whitelist of possible topic status ID's 291 } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( bbp_get_topic_statuses()) ) ) {294 } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( $topic_statuses ) ) ) { 292 295 $topic_status = sanitize_key( $_POST['bbp_topic_status'] ); 293 296 … … 628 631 /** Topic Status **********************************************************/ 629 632 633 // Get available topic statuses 634 $topic_statuses = bbp_get_topic_statuses( $topic_id ); 635 630 636 // Maybe put into moderation 631 637 if ( ! bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) { … … 637 643 638 644 // Check a whitelist of possible topic status ID's 639 } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( bbp_get_topic_statuses()) ) ) {645 } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( $topic_statuses ) ) ) { 640 646 $topic_status = sanitize_key( $_POST['bbp_topic_status'] ); 641 647 … … 2008 2014 * @since 2.4.0 bbPress (r5059) 2009 2015 * 2016 * @param int $topic_id Optional. Topic id. 2017 * 2010 2018 * @return array 2011 2019 */ 2012 function bbp_get_topic_statuses( ) {2020 function bbp_get_topic_statuses( $topic_id = 0 ) { 2013 2021 return apply_filters( 'bbp_get_topic_statuses', array( 2014 2022 bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ), … … 2017 2025 bbp_get_trash_status_id() => _x( 'Trash', 'Trash the topic', 'bbpress' ), 2018 2026 bbp_get_pending_status_id() => _x( 'Pending', 'Mark topic as pending', 'bbpress' ), 2019 ) );2027 ), $topic_id ); 2020 2028 } 2021 2029 … … 2025 2033 * @since 2.4.0 bbPress (r5059) 2026 2034 * 2035 * @param int $topic_id Optional. Topic id. 2036 * 2027 2037 * @return array 2028 2038 */ 2029 function bbp_get_topic_types( ) {2039 function bbp_get_topic_types( $topic_id = 0 ) { 2030 2040 return apply_filters( 'bbp_get_topic_types', array( 2031 2041 'unstick' => _x( 'Normal', 'Unstick a topic', 'bbpress' ), 2032 2042 'stick' => _x( 'Sticky', 'Make topic sticky', 'bbpress' ), 2033 2043 'super' => _x( 'Super Sticky', 'Make topic super sticky', 'bbpress' ) 2034 ) );2044 ), $topic_id ); 2035 2045 } 2036 2046
Note: See TracChangeset
for help on using the changeset viewer.