Changeset 6026
- Timestamp:
- 05/19/2016 07:35:41 PM (8 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r5954 r6026 1791 1791 * @since 2.4.0 bbPress (r5059) 1792 1792 * 1793 * @param int $forum_id Optional. Forum id. 1794 * 1793 1795 * @return array 1794 1796 */ 1795 function bbp_get_forum_statuses( ) {1797 function bbp_get_forum_statuses( $forum_id = 0 ) { 1796 1798 return apply_filters( 'bbp_get_forum_statuses', array( 1797 1799 'open' => _x( 'Open', 'Open the forum', 'bbpress' ), 1798 1800 'closed' => _x( 'Closed', 'Close the forum', 'bbpress' ) 1799 ) );1801 ), $forum_id ); 1800 1802 } 1801 1803 … … 1805 1807 * @since 2.4.0 bbPress (r5059) 1806 1808 * 1809 * @param int $forum_id Optional. Forum id. 1810 * 1807 1811 * @return array 1808 1812 */ 1809 function bbp_get_forum_types( ) {1813 function bbp_get_forum_types( $forum_id = 0 ) { 1810 1814 return apply_filters( 'bbp_get_forum_types', array( 1811 1815 'forum' => _x( 'Forum', 'Forum accepts new topics', 'bbpress' ), 1812 1816 'category' => _x( 'Category', 'Forum is a category', 'bbpress' ) 1813 ) );1817 ), $forum_id ); 1814 1818 } 1815 1819 … … 1819 1823 * @since 2.4.0 bbPress (r5059) 1820 1824 * 1825 * @param int $forum_id Optional. Forum id. 1826 * 1821 1827 * @return array 1822 1828 */ 1823 function bbp_get_forum_visibilities( ) {1829 function bbp_get_forum_visibilities( $forum_id = 0) { 1824 1830 return apply_filters( 'bbp_get_forum_visibilities', array( 1825 1831 bbp_get_public_status_id() => _x( 'Public', 'Make forum public', 'bbpress' ), 1826 1832 bbp_get_private_status_id() => _x( 'Private', 'Make forum private', 'bbpress' ), 1827 1833 bbp_get_hidden_status_id() => _x( 'Hidden', 'Make forum hidden', 'bbpress' ) 1828 ) );1834 ), $forum_id ); 1829 1835 } 1830 1836 -
trunk/src/includes/forums/template.php
r6024 r6026 2683 2683 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>> 2684 2684 2685 <?php foreach ( bbp_get_forum_types( ) as $key => $label ) : ?>2685 <?php foreach ( bbp_get_forum_types( $r['forum_id'] ) as $key => $label ) : ?> 2686 2686 2687 2687 <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option> … … 2775 2775 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>> 2776 2776 2777 <?php foreach ( bbp_get_forum_statuses( ) as $key => $label ) : ?>2777 <?php foreach ( bbp_get_forum_statuses( $r['forum_id'] ) as $key => $label ) : ?> 2778 2778 2779 2779 <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option> … … 2867 2867 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>> 2868 2868 2869 <?php foreach ( bbp_get_forum_visibilities( ) as $key => $label ) : ?>2869 <?php foreach ( bbp_get_forum_visibilities( $r['forum_id'] ) as $key => $label ) : ?> 2870 2870 2871 2871 <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option> -
trunk/src/includes/replies/functions.php
r5969 r6026 1696 1696 * @since 2.6.0 bbPress (r5399) 1697 1697 * 1698 * @param int $reply_id Optional. Reply id. 1699 * 1698 1700 * @return array 1699 1701 */ 1700 function bbp_get_reply_statuses( ) {1702 function bbp_get_reply_statuses( $reply_id = 0 ) { 1701 1703 return apply_filters( 'bbp_get_reply_statuses', array( 1702 1704 bbp_get_public_status_id() => _x( 'Publish', 'Publish the reply', 'bbpress' ), … … 1704 1706 bbp_get_trash_status_id() => _x( 'Trash', 'Trash the reply', 'bbpress' ), 1705 1707 bbp_get_pending_status_id() => _x( 'Pending', 'Mark reply as pending', 'bbpress' ), 1706 ) );1708 ), $reply_id ); 1707 1709 } 1708 1710 -
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.