Edit post slugs.

git-svn-id: http://svn.automattic.com/wordpress/trunk@870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-02-13 11:21:30 +00:00
parent 0a38396833
commit 718dcc6297
4 changed files with 22 additions and 13 deletions

View File

@ -63,14 +63,16 @@ window.onload = focusit;
<label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post_status, 'private'); ?> /> Private</label></div>
</fieldset>
<fieldset id="commentstatusdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a></legend>
<div><label for="comment_status_open" class="selectit"><input id="comment_status_open" name="comment_status" type="radio" value="open" <?php checked($comment_status, 'open'); ?> /> Open</label>
<label for="comment_status_closed" class="selectit"><input id="comment_status_closed" name="comment_status" type="radio" value="closed" <?php checked($comment_status, 'closed'); ?> /> Closed</label></div>
<legend><a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Discussion</a></legend>
<div><label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($comment_status, 'open'); ?> />
Allow Comments</label>
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($ping_status, 'open'); ?> /> Allow Pings</label>
</div>
</fieldset>
<fieldset id="pingstatusdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a></legend>
<div><label for="ping_status_open" class="selectit"><input id="ping_status_open" name="ping_status" type="radio" value="open" <?php checked($ping_status, 'open'); ?> /> Open</label>
<label for="ping_status_closed" class="selectit"><input id="ping_status_closed" name="ping_status" type="radio" value="closed" <?php checked($ping_status, 'closed'); ?> /> Closed</label></div>
<fieldset id="slugdiv">
<legend>Post Slug</legend>
<div><input name="post_name" type="text" size="17" id="post_name" value="<?php echo $post_name ?>" /></div>
</fieldset>
<fieldset id="postpassworddiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post_password" title="Help on post password">Post Password</a></legend>

View File

@ -221,6 +221,7 @@ switch($action) {
$post_password = $postdata['post_password'];
$to_ping = $postdata['to_ping'];
$pinged = $postdata['pinged'];
$post_name = $postdata['post_name'];
include('edit-form-advanced.php');
$p = $_GET['post'];
@ -288,7 +289,8 @@ switch($action) {
$ping_status = $HTTP_POST_VARS['ping_status'];
if (empty($ping_status)) $post_status = get_settings('default_ping_status');
$post_password = addslashes($HTTP_POST_VARS['post_password']);
$post_name = sanitize_title($post_title);
$post_name = sanitize_title($_POST['post_name']);
if (empty($post_name)) $post_name = sanitize_title($post_title);
$trackback = $HTTP_POST_VARS['trackback_url'];
// Format trackbacks
$trackback = preg_replace('|\s+|', '\n', $trackback);

View File

@ -283,10 +283,14 @@ textarea, input, select {
clear: both;
}
#poststatusdiv, #commentstatusdiv, #pingstatusdiv {
#poststatusdiv, #pingstatusdiv, #commentstatusdiv {
width: 6.5em;
}
#slugdiv {
width: 9.4em;
}
#poststuff {
margin-right: 11em;
}
@ -321,7 +325,7 @@ textarea, input, select {
text-align: right;
}
#titlediv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv, #namediv, #uridiv, #emaildiv {
#titlediv, #poststatusdiv, #commentstatusdiv, #slugdiv, #postpassworddiv, #namediv, #uridiv, #emaildiv {
float: left;
height: 6em;
margin-right: 5px;

View File

@ -325,7 +325,8 @@ function get_postdata($postid) {
'ping_status' => $post->ping_status,
'post_password' => $post->post_password,
'to_ping' => $post->to_ping,
'pinged' => $post->pinged
'pinged' => $post->pinged,
'post_name' => $post->post_name
);
return $postdata;
}