WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/06/2004 02:18:37 AM (15 years ago)
Author:
rboren
Message:

Page/subpage URIs.

File:
1 edited

Legend:

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

    r1751 r1752  
    5757        $post_status = $_POST['post_status'];
    5858        $post_name = $_POST['post_name'];
     59        $post_parent = 0;
     60        if (isset($_POST['parent_id'])) {
     61            $post_parent = $_POST['parent_id'];
     62        }
    5963
    6064        if (empty($post_status)) $post_status = 'draft';
     
    109113
    110114    $postquery ="INSERT INTO $wpdb->posts
    111             (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)
     115            (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt, post_parent)
    112116            VALUES
    113             ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
     117            ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt', '$post_parent')
    114118            ";
    115119
     
    195199    } // end if publish
    196200
     201    if ($post_status = 'static') {
     202        generate_page_rewrite_rules();
     203    }
     204
    197205    exit();
    198206    break;
     
    223231        $pinged = $postdata->pinged;
    224232        $post_name = $postdata->post_name;
    225 
    226         if ($post_status == 'static') {
    227             include('edit-page-form.php');
    228         } else {
    229             include('edit-form-advanced.php');
    230         }
     233        $post_parent = $postdata->post_parent;
     234
     235        if ($post_status == 'static') {
     236            include('edit-page-form.php');
     237        } else {
     238            include('edit-form-advanced.php');
     239        }
    231240
    232241        $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'");
     
    287296        if (empty($post_name)) {
    288297          $post_name = $post_title;
     298        }
     299
     300        $post_parent = 0;
     301        if (isset($_POST['parent_id'])) {
     302            $post_parent = $_POST['parent_id'];
    289303        }
    290304
     
    354368            to_ping = '$trackback',
    355369            post_modified = '$now',
    356             post_modified_gmt = '$now_gmt'
     370            post_modified_gmt = '$now_gmt',
     371      post_parent = '$post_parent'
    357372        WHERE ID = $post_ID ");
    358373
     
    421436        }
    422437    } // end if publish
     438
     439    if ($post_status = 'static') {
     440        generate_page_rewrite_rules();
     441    }
    423442
    424443    do_action('edit_post', $post_ID);
Note: See TracChangeset for help on using the changeset viewer.