Changeset 9683
- Timestamp:
- 11/14/2008 05:13:08 PM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-page-form.php
r9643 r9683 357 357 add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core'); 358 358 359 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM359 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM 360 360 if ( $post->post_author && !in_array($post->post_author, $authors) ) 361 361 $authors[] = $post->post_author; … … 370 370 function page_author_meta_box($post){ 371 371 global $current_user, $user_ID; 372 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM372 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM 373 373 if ( $post->post_author && !in_array($post->post_author, $authors) ) 374 374 $authors[] = $post->post_author; -
trunk/wp-admin/includes/user.php
r9589 r9683 221 221 * @return unknown 222 222 */ 223 function get_editable_user_ids( $user_id, $exclude_zeros = true ) {223 function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) { 224 224 global $wpdb; 225 225 226 226 $user = new WP_User( $user_id ); 227 227 228 if ( ! $user->has_cap( 'edit_others_posts') ) {229 if ( $user->has_cap( 'edit_posts') || $exclude_zeros == false )228 if ( ! $user->has_cap("edit_others_{$post_type}s") ) { 229 if ( $user->has_cap("edit_{$post_type}s") || $exclude_zeros == false ) 230 230 return array($user->id); 231 231 else
Note: See TracChangeset
for help on using the changeset viewer.