Changeset 4673 for trunk/includes/replies/template-tags.php
- Timestamp:
- 12/31/2012 02:26:17 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/replies/template-tags.php
r4648 r4673 69 69 /** Defaults **************************************************************/ 70 70 71 // What are the default allowed statuses (based on user caps) 72 if ( bbp_get_view_all( 'edit_others_replies' ) ) { 73 $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ); 74 } else { 75 $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() ); 76 } 77 78 // Add support for private status 79 if ( current_user_can( 'read_private_replies' ) ) { 80 $post_statuses[] = bbp_get_private_status_id(); 81 } 82 71 // Other defaults 83 72 $default_reply_search = !empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false; 84 73 $default_post_parent = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any'; 85 74 $default_post_type = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ); 86 $default_post_status = join( ',', $post_statuses );87 75 88 76 // Default query args … … 90 78 'post_type' => $default_post_type, // Only replies 91 79 'post_parent' => $default_post_parent, // Of this topic 92 'post_status' => $default_post_status, // Of this status93 80 'posts_per_page' => bbp_get_replies_per_page(), // This many 94 81 'paged' => bbp_get_paged(), // On this page … … 97 84 's' => $default_reply_search, // Maybe search 98 85 ); 86 87 // What are the default allowed statuses (based on user caps) 88 if ( bbp_get_view_all() ) { 89 90 // Default view=all statuses 91 $post_statuses = array( 92 bbp_get_public_status_id(), 93 bbp_get_closed_status_id(), 94 bbp_get_spam_status_id(), 95 bbp_get_trash_status_id() 96 ); 97 98 // Add support for private status 99 if ( current_user_can( 'read_private_replies' ) ) { 100 $post_statuses[] = bbp_get_private_status_id(); 101 } 102 103 // Join post statuses together 104 $default['post_status'] = join( ',', $post_statuses ); 105 106 // Lean on the 'perm' query var value of 'readable' to provide statuses 107 } else { 108 $default['perm'] = 'readable'; 109 } 99 110 100 111 /** Setup *****************************************************************/
Note: See TracChangeset
for help on using the changeset viewer.