Changeset 3505 for branches/plugin/bbp-includes/bbp-topic-template.php
- Timestamp:
- 09/10/2011 10:27:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-template.php
r3501 r3505 71 71 // What are the default allowed statuses (based on user caps) 72 72 if ( !bbp_is_query_name( 'bbp_widget' ) && bbp_get_view_all() ) 73 $default_status = join( ',', array( 'publish', $bbp->closed_status_id, $bbp->spam_status_id, 'trash') );73 $default_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ); 74 74 else 75 $default_status = join( ',', array( 'publish', $bbp->closed_status_id) );75 $default_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ); 76 76 77 77 // Default arguments … … 121 121 extract( $bbp_t ); 122 122 123 // If we're viewing a tax/term, use the existing query; if not, run our own 124 if ( bbp_is_topic_tag() && !bbp_is_query_name( 'bbp_widget' ) ) 125 $bbp->topic_query = $wp_query; 126 else 127 $bbp->topic_query = new WP_Query( $bbp_t ); 123 // Call the query 124 $bbp->topic_query = new WP_Query( $bbp_t ); 128 125 129 126 // Set post_parent back to 0 if originally set to 'any' … … 904 901 */ 905 902 function bbp_is_topic_closed( $topic_id = 0 ) { 906 global $bbp; 907 908 if ( $bbp->closed_status_id == bbp_get_topic_status( $topic_id ) ) 903 if ( bbp_get_closed_status_id() == bbp_get_topic_status( $topic_id ) ) 909 904 return true; 910 905 … … 966 961 */ 967 962 function bbp_is_topic_published( $topic_id = 0 ) { 968 global $bbp;969 970 963 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ); 971 return 'publish'== $topic_status;964 return bbp_get_public_status_id() == $topic_status; 972 965 } 973 966 … … 983 976 */ 984 977 function bbp_is_topic_spam( $topic_id = 0 ) { 985 global $bbp;986 987 978 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ); 988 return $bbp->spam_status_id== $topic_status;979 return bbp_get_spam_status_id() == $topic_status; 989 980 } 990 981 … … 1000 991 */ 1001 992 function bbp_is_topic_trash( $topic_id = 0 ) { 1002 global $bbp;1003 1004 993 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ); 1005 return $bbp->trash_status_id== $topic_status;994 return bbp_get_trash_status_id() == $topic_status; 1006 995 } 1007 996 … … 1703 1692 */ 1704 1693 function bbp_get_topic_replies_link( $topic_id = 0 ) { 1705 global $bbp;1706 1694 1707 1695 $topic = bbp_get_topic( bbp_get_topic_id( (int) $topic_id ) ); … … 1990 1978 */ 1991 1979 function bbp_get_topic_admin_links( $args = '' ) { 1992 global $bbp;1993 1980 1994 1981 if ( !bbp_is_single_topic() ) … … 2025 2012 // See if links need to be unset 2026 2013 $topic_status = bbp_get_topic_status( $r['id'] ); 2027 if ( in_array( $topic_status, array( $bbp->spam_status_id, $bbp->trash_status_id) ) ) {2014 if ( in_array( $topic_status, array( bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ) ) { 2028 2015 2029 2016 // Close link shouldn't be visible on trashed/spammed topics … … 2031 2018 2032 2019 // Spam link shouldn't be visible on trashed topics 2033 if ( $topic_status == $bbp->trash_status_id)2020 if ( $topic_status == bbp_get_trash_status_id() ) 2034 2021 unset( $r['links']['spam'] ); 2035 2022 2036 2023 // Trash link shouldn't be visible on spam topics 2037 elseif ( $topic_status == $bbp->spam_status_id)2024 elseif ( $topic_status == bbp_get_spam_status_id() ) 2038 2025 unset( $r['links']['trash'] ); 2039 2026 } … … 2187 2174 */ 2188 2175 function bbp_get_topic_trash_link( $args = '' ) { 2189 global $bbp;2190 2176 2191 2177 $defaults = array ( … … 2576 2562 */ 2577 2563 function bbp_topic_notices() { 2578 global $bbp;2579 2564 2580 2565 // Bail if not viewing a topic … … 2589 2574 2590 2575 // Spam notice 2591 case $bbp->spam_status_id:2576 case bbp_get_spam_status_id() : 2592 2577 $notice_text = __( 'This topic is marked as spam.', 'bbpress' ); 2593 2578 break; 2594 2579 2595 2580 // Trashed notice 2596 case $bbp->trash_status_id:2581 case bbp_get_trash_status_id() : 2597 2582 $notice_text = __( 'This topic is in the trash.', 'bbpress' ); 2598 2583 break; … … 3025 3010 */ 3026 3011 function bbp_get_topic_tag_description( $args = array() ) { 3027 global $bbp;3028 3012 3029 3013 $defaults = array( … … 3145 3129 */ 3146 3130 function bbp_get_form_topic_tags() { 3147 global $post , $bbp;3131 global $post; 3148 3132 3149 3133 // Get _POST data
Note: See TracChangeset
for help on using the changeset viewer.