Changeset 5060 for trunk/includes/forums/functions.php
- Timestamp:
- 08/02/2013 07:20:49 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/forums/functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/forums/functions.php
r5021 r5060 801 801 if ( bbp_get_public_status_id() !== $current_visibility ) { 802 802 803 // Update forum post_status 804 global $wpdb; 805 $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_public_status_id() ), array( 'ID' => $forum_id ) ); 806 wp_transition_post_status( bbp_get_public_status_id(), $current_visibility, get_post( $forum_id ) ); 803 // Update forums visibility setting 804 wp_insert_post( array( 805 'ID' => $forum_id, 806 'post_status' => bbp_get_public_status_id() 807 ) ); 807 808 } 808 809 … … 851 852 852 853 // Update forums visibility setting 853 global $wpdb; 854 $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_private_status_id() ), array( 'ID' => $forum_id ) ); 855 wp_transition_post_status( bbp_get_private_status_id(), $current_visibility, get_post( $forum_id ) ); 854 wp_insert_post( array( 855 'ID' => $forum_id, 856 'post_status' => bbp_get_private_status_id() 857 ) ); 856 858 } 857 859 … … 900 902 901 903 // Update forums visibility setting 902 global $wpdb; 903 $wpdb->update( $wpdb->posts, array( 'post_status' => bbp_get_hidden_status_id() ), array( 'ID' => $forum_id ) ); 904 wp_transition_post_status( bbp_get_hidden_status_id(), $current_visibility, get_post( $forum_id ) ); 904 wp_insert_post( array( 905 'ID' => $forum_id, 906 'post_status' => bbp_get_hidden_status_id() 907 ) ); 905 908 } 906 909 … … 1543 1546 } 1544 1547 1548 /** Helpers *******************************************************************/ 1549 1550 /** 1551 * Return an associative array of available topic statuses 1552 * 1553 * @since bbPress (r5059) 1554 * 1555 * @return array 1556 */ 1557 function bbp_get_forum_statuses() { 1558 return apply_filters( 'bbp_get_forum_statuses', array( 1559 'open' => _x( 'Open', 'Open the forum', 'bbpress' ), 1560 'closed' => _x( 'Closed', 'Close the forum', 'bbpress' ) 1561 ) ); 1562 } 1563 1564 /** 1565 * Return an associative array of forum types 1566 * 1567 * @since bbPress (r5059) 1568 * 1569 * @return array 1570 */ 1571 function bbp_get_forum_types() { 1572 return apply_filters( 'bbp_get_forum_types', array( 1573 'forum' => _x( 'Forum', 'Forum accepts new topics', 'bbpress' ), 1574 'category' => _x( 'Category', 'Forum is a category', 'bbpress' ) 1575 ) ); 1576 } 1577 1578 /** 1579 * Return an associative array of forum visibility 1580 * 1581 * @since bbPress (r5059) 1582 * 1583 * @return array 1584 */ 1585 function bbp_get_forum_visibilities() { 1586 return apply_filters( 'bbp_get_forum_visibilities', array( 1587 bbp_get_public_status_id() => _x( 'Public', 'Make forum public', 'bbpress' ), 1588 bbp_get_private_status_id() => _x( 'Private', 'Make forum private', 'bbpress' ), 1589 bbp_get_hidden_status_id() => _x( 'Hidden', 'Make forum hidden', 'bbpress' ) 1590 ) ); 1591 } 1592 1545 1593 /** Queries *******************************************************************/ 1546 1594
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)