Changeset 3607 for branches/plugin/bbp-includes/bbp-forum-functions.php
- Timestamp:
- 11/14/2011 03:50:25 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-functions.php
r3589 r3607 1147 1147 } 1148 1148 1149 /** Permissions ***************************************************************/ 1150 1151 /** 1152 * Redirect if unathorized user is attempting to edit a forum 1153 * 1154 * @since bbPress (r3607) 1155 * 1156 * @uses bbp_is_forum_edit() 1157 * @uses current_user_can() 1158 * @uses bbp_get_forum_id() 1159 * @uses wp_safe_redirect() 1160 * @uses bbp_get_forum_permalink() 1161 */ 1162 function bbp_check_forum_edit() { 1163 1164 // Bail if not editing a topic 1165 if ( !bbp_is_forum_edit() ) 1166 return; 1167 1168 // User cannot edit topic, so redirect back to reply 1169 if ( !current_user_can( 'edit_forum', bbp_get_forum_id() ) ) { 1170 wp_safe_redirect( bbp_get_forum_permalink() ); 1171 exit(); 1172 } 1173 } 1174 1149 1175 ?>
Note: See TracChangeset
for help on using the changeset viewer.