Make WordPress Core


Ignore:
Timestamp:
02/12/2006 07:53:23 AM (19 years ago)
Author:
ryan
Message:

Death to trailing tabs. Props Mark J. fixes #2405

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r3513 r3517  
    77    if ( 'page' == $_POST['post_type'] ) {
    88        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.'));
    1010    } else {
    1111        if ( !current_user_can('edit_posts') )
     
    3131
    3232    if ($_POST['post_author'] != $_POST['user_ID']) {
    33         if ( 'page' == $_POST['post_type'] ) {     
     33        if ( 'page' == $_POST['post_type'] ) {
    3434            if ( !current_user_can('edit_others_pages') )
    3535                die(__('You cannot create pages as this user.'));
     
    3737            if ( !current_user_can('edit_others_posts') )
    3838                die(__('You cannot post as this user.'));
    39            
     39
    4040        }
    4141    }
     
    5353    if ( 'page' == $_POST['post_type'] ) {
    5454        if ('publish' == $_POST['post_status'] && !current_user_can('publish_pages'))
    55             $_POST['post_status'] = 'draft';   
     55            $_POST['post_status'] = 'draft';
    5656    } else {
    5757        if ('publish' == $_POST['post_status'] && !current_user_can('publish_posts'))
     
    141141    if ( 'page' == $_POST['post_type'] ) {
    142142        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.'));
    144144    } else {
    145145        if ( !current_user_can('edit_post', $post_ID) )
     
    164164
    165165    if ($_POST['post_author'] != $_POST['user_ID']) {
    166         if ( 'page' == $_POST['post_type'] ) {     
     166        if ( 'page' == $_POST['post_type'] ) {
    167167            if ( !current_user_can('edit_others_pages') )
    168168                die(__('You cannot edit pages as this user.'));
     
    170170            if ( !current_user_can('edit_others_posts') )
    171171                die(__('You cannot edit posts as this user.'));
    172            
     172
    173173        }
    174174    }
     
    186186    if ( 'page' == $_POST['post_type'] ) {
    187187        if ('publish' == $_POST['post_status'] && !current_user_can('edit_published_pages'))
    188             $_POST['post_status'] = 'draft';   
     188            $_POST['post_status'] = 'draft';
    189189    } else {
    190190        if ('publish' == $_POST['post_status'] && !current_user_can('edit_published_posts'))
     
    218218            update_meta($key, $value['key'], $value['value']);
    219219    }
    220    
     220
    221221    if ($_POST['deletemeta']) {
    222222        foreach ($_POST['deletemeta'] as $key => $value)
     
    465465function get_link_to_edit($link_id) {
    466466    $link = get_link($link_id);
    467    
     467
    468468    $link->link_url = wp_specialchars($link->link_url, 1);
    469469    $link->link_name = wp_specialchars($link->link_name, 1);
     
    471471    $link->link_notes = wp_specialchars($link->link_notes);
    472472    $link->link_rss = wp_specialchars($link->link_rss);
    473    
     473
    474474    return $link;
    475475}
     
    480480    else
    481481        $link->link_url = '';
    482    
     482
    483483    if ( isset($_GET['name']) )
    484484        $link->link_name = wp_specialchars($_GET['name'], 1);
    485485    else
    486486        $link->link_name = '';
    487        
     487
    488488    return $link;
    489489}
    490490
    491491function add_link() {
    492     return edit_link(); 
     492    return edit_link();
    493493}
    494494
     
    503503    $_POST['link_rss'] = wp_specialchars($_POST['link_rss']);
    504504    $auto_toggle = get_autotoggle($_POST['link_category']);
    505    
     505
    506506    // if we are in an auto toggle category and this one is visible then we
    507507    // need to make the others invisible before we add this new one.
     
    578578        }
    579579    }
    580    
     580
    581581    usort($result, 'sort_cats');
    582582
     
    616616                    $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__('Edit')."</a></td>";
    617617                    $default_cat_id = get_option('default_category');
    618                    
     618
    619619                    if ($category->cat_ID != $default_cat_id)
    620620                        $edit .= "<td><a href='categories.php?action=delete&amp;cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category &quot;%s&quot;.  All of its posts will go to the default category.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>";
     
    700700function link_category_dropdown($fieldname, $selected = 0) {
    701701    global $wpdb;
    702    
     702
    703703    $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id");
    704704    echo "\n<select name='$fieldname' size='1'>\n";
     
    18351835</div>
    18361836</form>
    1837 <?php   
     1837<?php
    18381838}
    18391839
Note: See TracChangeset for help on using the changeset viewer.