Make WordPress Core


Ignore:
Timestamp:
02/09/2006 10:03:48 AM (19 years ago)
Author:
ryan
Message:

Allow draft pages. Use post_type for object types. Reserve post_status strictly for status. fixes #1820

File:
1 edited

Legend:

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

    r3501 r3510  
    3535    if ('' != $_POST['advanced'])
    3636        $_POST['post_status'] = 'draft';
    37     if ('' != $_POST['savepage'])
    38         $_POST['post_status'] = 'static';
     37    //if ('' != $_POST['savepage']) {
     38    //  $_POST['post_status'] = 'draft';
    3939
    4040    if ('publish' == $_POST['post_status'] && !current_user_can('publish_posts'))
    4141        $_POST['post_status'] = 'draft';
    4242
    43     if ('static' == $_POST['post_status'] && !current_user_can('edit_pages'))
     43    if ('page' == $_POST['post_type'] && !current_user_can('edit_pages'))
    4444        die(__('This user cannot edit pages.'));
    4545
     
    155155    if ('' != $_POST['advanced'])
    156156        $_POST['post_status'] = 'draft';
    157     if ('' != $_POST['savepage'])
    158         $_POST['post_status'] = 'static';
     157    //if ('' != $_POST['savepage'])
     158    //  $_POST['post_status'] = 'static';
    159159
    160160    if ('publish' == $_POST['post_status'] && !current_user_can('publish_posts'))
     
    255255    $post->post_title = apply_filters('title_edit_pre', $post->post_title);
    256256
    257     if ($post->post_status == 'static')
     257    if ($post->post_type == 'page')
    258258        $post->page_template = get_post_meta($id, '_wp_page_template', true);
    259259
     
    614614    global $wpdb, $class, $post;
    615615    if (!$pages)
    616         $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' ORDER BY menu_order");
     616        $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY menu_order");
    617617
    618618    if ($pages) {
     
    11771177function parent_dropdown($default = 0, $parent = 0, $level = 0) {
    11781178    global $wpdb, $post_ID;
    1179     $items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_status = 'static' ORDER BY menu_order");
     1179    $items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_type = 'page' ORDER BY menu_order");
    11801180
    11811181    if ($items) {
     
    18491849    $post = & get_post($id);
    18501850
    1851     if ( $post->post_status != 'attachment' )
     1851    if ( $post->post_type != 'attachment' )
    18521852        return false;
    18531853
Note: See TracChangeset for help on using the changeset viewer.