Ticket #2257: edit_pages_fix.diff
File edit_pages_fix.diff, 4.5 KB (added by , 19 years ago) |
---|
-
inline-uploading.php
2 2 3 3 require_once('admin.php'); 4 4 5 if ( !current_user_can('edit_posts'))5 if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) 6 6 die(__('You do not have permission to edit posts.')); 7 7 8 8 $wpvarstoreset = array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment'); -
menu.php
5 5 // The minimum level the user needs to access the item: between 0 and 10 6 6 // The URL of the item's file 7 7 $menu[0] = array(__('Dashboard'), 'read', 'index.php'); 8 $menu[5] = array(__('Write'), 'edit_posts', 'post.php'); 9 $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php'); 8 if ( current_user_can('edit_posts') ) { 9 $menu[5] = array(__('Write'), 'edit_posts', 'post.php'); 10 $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php'); 11 } else { 12 $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php'); 13 $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php'); 14 } 10 15 $menu[20] = array(__('Links'), 'manage_links', 'link-manager.php'); 11 16 $menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php'); 12 17 $menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); … … 17 22 $menu[40] = array(__('Options'), 'manage_options', 'options-general.php'); 18 23 $menu[45] = array(__('Import'), 'import', 'import.php'); 19 24 20 $submenu['post.php'][5] = array(__('Write Post'), 'edit_posts', 'post.php'); 21 $submenu['post.php'][10] = array(__('Write Page'), 'edit_pages', 'page-new.php'); 25 if ( current_user_can('edit_posts') ) { 26 $submenu['post.php'][5] = array(__('Write Post'), 'edit_posts', 'post.php'); 27 $submenu['post.php'][10] = array(__('Write Page'), 'edit_pages', 'page-new.php'); 28 $submenu['edit.php'][5] = array(__('Posts'), 'edit_posts', 'edit.php'); 29 $submenu['edit.php'][10] = array(__('Pages'), 'edit_pages', 'edit-pages.php'); 30 } else { 31 $submenu['page-new.php'][10] = array(__('Write Page'), 'edit_pages', 'page-new.php'); 32 $submenu['edit-pages.php'][10] = array(__('Pages'), 'edit_pages', 'edit-pages.php'); 33 } 22 34 23 $submenu['edit.php'][5] = array(__('Posts'), 'edit_posts', 'edit.php');24 $submenu['edit.php'][10] = array(__('Pages'), 'edit_pages', 'edit-pages.php');25 35 $submenu['edit.php'][15] = array(__('Categories'), 'manage_categories', 'categories.php'); 26 36 $submenu['edit.php'][20] = array(__('Comments'), 'edit_posts', 'edit-comments.php'); 27 37 $awaiting_mod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); -
post.php
30 30 31 31 switch($action) { 32 32 case 'post': 33 if ( !current_user_can('edit_posts') && current_user_can('edit_pages') ) 34 $parent_file = 'page-new.php'; 33 35 34 36 $post_ID = write_post(); 35 37 … … 61 63 break; 62 64 63 65 case 'edit': 66 if ( !current_user_can('edit_posts') ) 67 $parent_file = 'page-new.php'; 64 68 $title = __('Edit'); 65 69 66 70 require_once('admin-header.php'); -
admin-functions.php
4 4 function write_post() { 5 5 global $user_ID; 6 6 7 if ( !current_user_can('edit_posts'))7 if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) 8 8 die(__('You are not allowed to create posts or drafts on this blog.')); 9 9 10 10 // Rename. -
page-new.php
1 1 <?php 2 2 require_once('admin.php'); 3 3 $title = __('New Page'); 4 $parent_file = 'post.php'; 4 if ( current_user_can('edit_posts') ) 5 $parent_file = 'post.php'; 6 else 7 $parent_file = 'page-new.php'; 5 8 $editing = true; 6 9 require_once('admin-header.php'); 7 10 ?> -
edit-pages.php
1 1 <?php 2 2 require_once('admin.php'); 3 3 $title = __('Pages'); 4 $parent_file = 'edit.php'; 4 if ( current_user_can('edit_posts') ) 5 $parent_file = 'edit.php'; 6 else 7 $parent_file = 'edit-pages.php'; 5 8 require_once('admin-header.php'); 6 9 ?> 7 10