Changeset 3517 for trunk/wp-admin/admin-functions.php
- Timestamp:
- 02/12/2006 07:53:23 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r3513 r3517 7 7 if ( 'page' == $_POST['post_type'] ) { 8 8 if ( !current_user_can('edit_pages') ) 9 die(__('You are not allowed to create pages on this blog.')); 9 die(__('You are not allowed to create pages on this blog.')); 10 10 } else { 11 11 if ( !current_user_can('edit_posts') ) … … 31 31 32 32 if ($_POST['post_author'] != $_POST['user_ID']) { 33 if ( 'page' == $_POST['post_type'] ) { 33 if ( 'page' == $_POST['post_type'] ) { 34 34 if ( !current_user_can('edit_others_pages') ) 35 35 die(__('You cannot create pages as this user.')); … … 37 37 if ( !current_user_can('edit_others_posts') ) 38 38 die(__('You cannot post as this user.')); 39 39 40 40 } 41 41 } … … 53 53 if ( 'page' == $_POST['post_type'] ) { 54 54 if ('publish' == $_POST['post_status'] && !current_user_can('publish_pages')) 55 $_POST['post_status'] = 'draft'; 55 $_POST['post_status'] = 'draft'; 56 56 } else { 57 57 if ('publish' == $_POST['post_status'] && !current_user_can('publish_posts')) … … 141 141 if ( 'page' == $_POST['post_type'] ) { 142 142 if ( !current_user_can('edit_page', $post_ID) ) 143 die(__('You are not allowed to edit this page.')); 143 die(__('You are not allowed to edit this page.')); 144 144 } else { 145 145 if ( !current_user_can('edit_post', $post_ID) ) … … 164 164 165 165 if ($_POST['post_author'] != $_POST['user_ID']) { 166 if ( 'page' == $_POST['post_type'] ) { 166 if ( 'page' == $_POST['post_type'] ) { 167 167 if ( !current_user_can('edit_others_pages') ) 168 168 die(__('You cannot edit pages as this user.')); … … 170 170 if ( !current_user_can('edit_others_posts') ) 171 171 die(__('You cannot edit posts as this user.')); 172 172 173 173 } 174 174 } … … 186 186 if ( 'page' == $_POST['post_type'] ) { 187 187 if ('publish' == $_POST['post_status'] && !current_user_can('edit_published_pages')) 188 $_POST['post_status'] = 'draft'; 188 $_POST['post_status'] = 'draft'; 189 189 } else { 190 190 if ('publish' == $_POST['post_status'] && !current_user_can('edit_published_posts')) … … 218 218 update_meta($key, $value['key'], $value['value']); 219 219 } 220 220 221 221 if ($_POST['deletemeta']) { 222 222 foreach ($_POST['deletemeta'] as $key => $value) … … 465 465 function get_link_to_edit($link_id) { 466 466 $link = get_link($link_id); 467 467 468 468 $link->link_url = wp_specialchars($link->link_url, 1); 469 469 $link->link_name = wp_specialchars($link->link_name, 1); … … 471 471 $link->link_notes = wp_specialchars($link->link_notes); 472 472 $link->link_rss = wp_specialchars($link->link_rss); 473 473 474 474 return $link; 475 475 } … … 480 480 else 481 481 $link->link_url = ''; 482 482 483 483 if ( isset($_GET['name']) ) 484 484 $link->link_name = wp_specialchars($_GET['name'], 1); 485 485 else 486 486 $link->link_name = ''; 487 487 488 488 return $link; 489 489 } 490 490 491 491 function add_link() { 492 return edit_link(); 492 return edit_link(); 493 493 } 494 494 … … 503 503 $_POST['link_rss'] = wp_specialchars($_POST['link_rss']); 504 504 $auto_toggle = get_autotoggle($_POST['link_category']); 505 505 506 506 // if we are in an auto toggle category and this one is visible then we 507 507 // need to make the others invisible before we add this new one. … … 578 578 } 579 579 } 580 580 581 581 usort($result, 'sort_cats'); 582 582 … … 616 616 $edit = "<a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>".__('Edit')."</a></td>"; 617 617 $default_cat_id = get_option('default_category'); 618 618 619 619 if ($category->cat_ID != $default_cat_id) 620 620 $edit .= "<td><a href='categories.php?action=delete&cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category "%s". All of its posts will go to the default category.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>"; … … 700 700 function link_category_dropdown($fieldname, $selected = 0) { 701 701 global $wpdb; 702 702 703 703 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id"); 704 704 echo "\n<select name='$fieldname' size='1'>\n"; … … 1835 1835 </div> 1836 1836 </form> 1837 <?php 1837 <?php 1838 1838 } 1839 1839
Note: See TracChangeset
for help on using the changeset viewer.