Page editing form cleaning and repair.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-06-19 03:07:16 +00:00
parent 0b7373e0cc
commit 4cb88cef6e
3 changed files with 8 additions and 9 deletions

View File

@ -149,6 +149,9 @@ function get_default_post_to_edit() {
$post->post_content = apply_filters('default_content', $content); $post->post_content = apply_filters('default_content', $content);
$post->post_title = apply_filters('default_title', $edited_post_title); $post->post_title = apply_filters('default_title', $edited_post_title);
$post->post_excerpt = apply_filters('default_excerpt', $excerpt); $post->post_excerpt = apply_filters('default_excerpt', $excerpt);
$post->page_template = 'default';
$post->post_parent = 0;
$post->menu_order = 0;
return $post; return $post;
} }

View File

@ -115,8 +115,8 @@ edCanvas = document.getElementById('content');
<select name="post_author" id="post_author"> <select name="post_author" id="post_author">
<?php <?php
foreach ($users as $o) : foreach ($users as $o) :
$o = get_userdata( $O->ID ); $o = get_userdata( $o->ID );
if ( $post->post_author == $o->ID ) $selected = 'selected="selected"'; if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
else $selected = ''; else $selected = '';
echo "<option value='$o->ID' $selected>$o->user_login ($o->first_name $o->last_name)</option>"; echo "<option value='$o->ID' $selected>$o->user_login ($o->first_name $o->last_name)</option>";
endforeach; endforeach;

View File

@ -15,13 +15,9 @@ get_currentuserinfo();
if ($user_level > 0) { if ($user_level > 0) {
$action = 'post'; $action = 'post';
get_currentuserinfo(); get_currentuserinfo();
//set defaults
$post_status = 'static'; $post = get_default_post_to_edit();
$comment_status = get_settings('default_comment_status'); $post->post_status = 'static';
$ping_status = get_settings('default_ping_status');
$post_pingback = get_settings('default_pingback_flag');
$post_parent = 0;
$page_template = 'default';
include('edit-page-form.php'); include('edit-page-form.php');
} }