Changeset 5834 for trunk/src/includes/replies/capabilities.php
- Timestamp:
- 07/15/2015 03:59:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/capabilities.php
r5829 r5834 40 40 * @uses get_post() To get the post 41 41 * @uses get_post_type_object() To get the post type object 42 * @uses bbp_get_public_status_id() To get the public status id 43 * @uses bbp_is_user_forum_mod() To check if the user is a forum moderator 44 * @uses bbp_get_reply_forum_id() To get the repliy forum id 42 45 * @uses apply_filters() Filter mapped results 46 * 43 47 * @return array Actual capabilities for meta capability 44 48 */ … … 63 67 if ( ! empty( $_post ) ) { 64 68 65 // Get caps forpost type object69 // Get post type object 66 70 $post_type = get_post_type_object( $_post->post_type ); 67 71 … … 118 122 if ( ! empty( $_post ) ) { 119 123 120 // Get caps forpost type object124 // Get post type object 121 125 $post_type = get_post_type_object( $_post->post_type ); 122 126 $caps = array(); … … 127 131 128 132 // User is author so allow edit if not in admin 129 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {133 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 130 134 $caps[] = $post_type->cap->edit_posts; 131 135 132 // Unknown, so map to edit_others_posts 136 // User is a per-forum moderator, make sure they can spectate. 137 } elseif ( bbp_allow_forum_mods() && bbp_is_user_forum_mod( $user_id, bbp_get_reply_forum_id( $_post->ID ) ) ) { 138 $caps = array( 'spectate' ); 139 140 // Fallback to edit_others_posts. 133 141 } else { 134 142 $caps[] = $post_type->cap->edit_others_posts; … … 146 154 if ( ! empty( $_post ) ) { 147 155 148 // Get caps forpost type object156 // Get post type object 149 157 $post_type = get_post_type_object( $_post->post_type ); 150 158 $caps = array();
Note: See TracChangeset
for help on using the changeset viewer.