Improvements to page handling. Move form to own page, put under "Write", ambiguiate language, and fix redirect.
git-svn-id: https://develop.svn.wordpress.org/trunk@1857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0ddb1564aa
commit
70fdfb4785
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2><?php _e('New Page'); ?></h2>
|
<h2><?php _e('Write Page'); ?></h2>
|
||||||
<?php
|
<?php
|
||||||
if (0 == $post_ID) {
|
if (0 == $post_ID) {
|
||||||
$form_action = 'post';
|
$form_action = 'post';
|
||||||
|
@ -54,23 +54,9 @@ $class = ('alternate' == $class) ? '' : 'alternate';
|
|||||||
<?php
|
<?php
|
||||||
} // end if ($posts)
|
} // end if ($posts)
|
||||||
?>
|
?>
|
||||||
|
<p><?php _e('Pages are like posts except they live outside of the normal blog chronology. You can use pages to organize and manage any amount of content.'); ?></p>
|
||||||
|
<h3><a href="page-new.php"><?php _e('Create New Page'); ?> »</a></h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
|
||||||
if ($user_level > 0) {
|
|
||||||
$action = 'post';
|
|
||||||
get_currentuserinfo();
|
|
||||||
//set defaults
|
|
||||||
$post_status = 'static';
|
|
||||||
$comment_status = get_settings('default_comment_status');
|
|
||||||
$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');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('admin-footer.php'); ?>
|
<?php include('admin-footer.php'); ?>
|
@ -15,6 +15,9 @@ $menu[40] = array(__('Presentation'), 8, 'themes.php');
|
|||||||
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
|
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
|
||||||
ksort($menu); // So other files can plugin
|
ksort($menu); // So other files can plugin
|
||||||
|
|
||||||
|
$submenu['post.php'][5] = array('Write Post', 1, 'post.php');
|
||||||
|
$submenu['post.php'][10] = array('Write Page', 5, 'page-new.php');
|
||||||
|
|
||||||
$submenu['edit.php'][5] = array(__('Posts'), 1, 'edit.php');
|
$submenu['edit.php'][5] = array(__('Posts'), 1, 'edit.php');
|
||||||
$submenu['edit.php'][10] = array(__('Pages'), 5, 'edit-pages.php');
|
$submenu['edit.php'][10] = array(__('Pages'), 5, 'edit-pages.php');
|
||||||
$submenu['edit.php'][15] = array(__('Categories'), 1, 'categories.php');
|
$submenu['edit.php'][15] = array(__('Categories'), 1, 'categories.php');
|
||||||
|
30
wp-admin/page-new.php
Normal file
30
wp-admin/page-new.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
require_once('admin.php');
|
||||||
|
$title = __('New Page');
|
||||||
|
$parent_file = 'post.php';
|
||||||
|
require_once('admin-header.php');
|
||||||
|
|
||||||
|
get_currentuserinfo();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php if ( isset($_GET['saved']) ) : ?>
|
||||||
|
<div class="updated"><p><strong><?php _e('Page saved.') ?> <a href="edit-pages.php"><?php _e('Manage pages'); ?> »</a></strong></p></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ($user_level > 0) {
|
||||||
|
$action = 'post';
|
||||||
|
get_currentuserinfo();
|
||||||
|
//set defaults
|
||||||
|
$post_status = 'static';
|
||||||
|
$comment_status = get_settings('default_comment_status');
|
||||||
|
$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');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php include('admin-footer.php'); ?>
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('admin.php');
|
require_once('admin.php');
|
||||||
|
|
||||||
$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder', 'enclosure_url' );
|
$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' );
|
||||||
|
|
||||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||||
$wpvar = $wpvarstoreset[$i];
|
$wpvar = $wpvarstoreset[$i];
|
||||||
@ -21,9 +21,8 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
|||||||
switch($action) {
|
switch($action) {
|
||||||
case 'post':
|
case 'post':
|
||||||
|
|
||||||
if (!user_can_create_draft($user_ID)) {
|
if ( !user_can_create_draft($user_ID) )
|
||||||
die('You are not allowed to create posts or drafts on this blog.');
|
die('You are not allowed to create posts or drafts on this blog.');
|
||||||
}
|
|
||||||
|
|
||||||
$post_pingback = intval($_POST['post_pingback']);
|
$post_pingback = intval($_POST['post_pingback']);
|
||||||
$content = apply_filters('content_save_pre', $_POST['content']);
|
$content = apply_filters('content_save_pre', $_POST['content']);
|
||||||
@ -114,12 +113,12 @@ case 'post':
|
|||||||
$location = 'post.php?posted=true';
|
$location = 'post.php?posted=true';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( 'static' == $_POST['post_status'] )
|
||||||
|
$location = "page-new.php?saved=true";
|
||||||
|
|
||||||
if ( '' != $_POST['advanced'] || isset($_POST['save']) )
|
if ( '' != $_POST['advanced'] || isset($_POST['save']) )
|
||||||
$location = "post.php?action=edit&post=$post_ID";
|
$location = "post.php?action=edit&post=$post_ID";
|
||||||
|
|
||||||
if ( '' != $_POST['savepage'] )
|
|
||||||
$location = "post.php?action=createpage";
|
|
||||||
|
|
||||||
header("Location: $location"); // Send user on their way while we keep working
|
header("Location: $location"); // Send user on their way while we keep working
|
||||||
|
|
||||||
// Insert categories
|
// Insert categories
|
||||||
|
Loading…
x
Reference in New Issue
Block a user