Changeset 4673 for trunk/includes/topics/template-tags.php
- Timestamp:
- 12/31/2012 02:26:17 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/topics/template-tags.php
r4647 r4673 87 87 /** Defaults **************************************************************/ 88 88 89 // What are the default allowed statuses (based on user caps) 90 if ( bbp_get_view_all() ) { 91 $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ); 92 } else { 93 $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() ); 94 } 95 96 // Add support for private status 97 if ( current_user_can( 'read_private_topics' ) ) { 98 $post_statuses[] = bbp_get_private_status_id(); 99 } 100 89 // Other defaults 101 90 $default_topic_search = !empty( $_REQUEST['ts'] ) ? $_REQUEST['ts'] : false; 102 91 $default_show_stickies = (bool) ( bbp_is_single_forum() || bbp_is_topic_archive() ) && ( false === $default_topic_search ); 103 92 $default_post_parent = bbp_is_single_forum() ? bbp_get_forum_id() : 'any'; 104 $default_post_status = join( ',', $post_statuses );105 93 106 94 // Default argument array … … 108 96 'post_type' => bbp_get_topic_post_type(), // Narrow query down to bbPress topics 109 97 'post_parent' => $default_post_parent, // Forum ID 110 'post_status' => $default_post_status, // Post Status111 98 'meta_key' => '_bbp_last_active_time', // Make sure topic has some last activity time 112 99 'orderby' => 'meta_value', // 'meta_value', 'author', 'date', 'title', 'modified', 'parent', rand', … … 118 105 'max_num_pages' => false, // Maximum number of pages to show 119 106 ); 107 108 // What are the default allowed statuses (based on user caps) 109 if ( bbp_get_view_all() ) { 110 111 // Default view=all statuses 112 $post_statuses = array( 113 bbp_get_public_status_id(), 114 bbp_get_closed_status_id(), 115 bbp_get_spam_status_id(), 116 bbp_get_trash_status_id() 117 ); 118 119 // Add support for private status 120 if ( current_user_can( 'read_private_topics' ) ) { 121 $post_statuses[] = bbp_get_private_status_id(); 122 } 123 124 // Join post statuses together 125 $default['post_status'] = join( ',', $post_statuses ); 126 127 // Lean on the 'perm' query var value of 'readable' to provide statuses 128 } else { 129 $default['perm'] = 'readable'; 130 } 120 131 121 132 // Maybe query for topic tags
Note: See TracChangeset
for help on using the changeset viewer.