mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@2062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
087df40d4a
commit
4015316834
@ -44,7 +44,9 @@ if (empty($post_status)) $post_status = 'draft';
|
||||
?>
|
||||
|
||||
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" name="action" value='<?php echo $form_action ?>' />
|
||||
<input type="hidden" name="action" value="<?php echo $form_action ?>" />
|
||||
<input type="hidden" name="post_author" value="<?php echo $post_author ?>" />
|
||||
|
||||
<?php echo $form_extra ?>
|
||||
<?php if (isset($_GET['message']) && 2 > $_GET['message']) : ?>
|
||||
<script type="text/javascript">
|
||||
@ -152,7 +154,7 @@ if ('publish' != $post_status || 0 == $post_ID) {
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Post author'); ?>:</th>
|
||||
<td>
|
||||
<select name="post_author" id="post_author">
|
||||
<select name="post_author_override" id="post_author_override">
|
||||
<?php
|
||||
foreach ($users as $o) :
|
||||
if ( $post_author == $o->ID ) $selected = 'selected="selected"';
|
||||
|
@ -239,7 +239,9 @@ case 'editpost':
|
||||
$prev_status = $_POST['prev_status'];
|
||||
$post_status = $_POST['post_status'];
|
||||
$menu_order = (int) $_POST['menu_order'];
|
||||
if (! empty($_POST['post_author'])) {
|
||||
if (! empty($_POST['post_author_override'])) {
|
||||
$post_author = (int) $_POST['post_author_override'];
|
||||
} else if (! empty($_POST['post_author'])) {
|
||||
$post_author = (int) $_POST['post_author'];
|
||||
} else {
|
||||
$post_author = (int) $_POST['user_ID'];
|
||||
|
@ -242,35 +242,30 @@ function get_cat_ID($cat_name='General') {
|
||||
}
|
||||
|
||||
// Get author's preferred display name
|
||||
function get_author_name($auth_id) {
|
||||
$authordata = get_userdata($auth_id);
|
||||
function get_author_name( $auth_id ) {
|
||||
$authordata = get_userdata( $auth_id );
|
||||
|
||||
switch($authordata["user_idmode"]) {
|
||||
case "nickname":
|
||||
$authorname = $authordata["user_nickname"];
|
||||
|
||||
case "login":
|
||||
$authorname = $authordata["user_login"];
|
||||
switch( $authordata['user_idmode'] ) {
|
||||
case 'nickname':
|
||||
$authorname = $authordata['user_nickname'];
|
||||
break;
|
||||
|
||||
case "firstname":
|
||||
$authorname = $authordata["user_firstname"];
|
||||
case 'login':
|
||||
$authorname = $authordata['user_login'];
|
||||
break;
|
||||
|
||||
case "lastname":
|
||||
$authorname = $authordata["user_lastname"];
|
||||
case 'firstname':
|
||||
$authorname = $authordata['user_firstname'];
|
||||
break;
|
||||
|
||||
case "namefl":
|
||||
$authorname = $authordata["user_firstname"]." ".$authordata["user_lastname"];
|
||||
case 'lastname':
|
||||
$authorname = $authordata['user_lastname'];
|
||||
break;
|
||||
|
||||
case "namelf":
|
||||
$authorname = $authordata["user_lastname"]." ".$authordata["user_firstname"];
|
||||
case 'namefl':
|
||||
$authorname = $authordata['user_firstname'].' '.$authordata['user_lastname'];
|
||||
break;
|
||||
case 'namelf':
|
||||
$authorname = $authordata['user_lastname'].' '.$authordata['user_firstname'];
|
||||
break;
|
||||
|
||||
default:
|
||||
$authorname = $authordata["user_nickname"];
|
||||
$authorname = $authordata['user_nickname'];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -279,7 +274,7 @@ function get_author_name($auth_id) {
|
||||
|
||||
// get extended entry info (<!--more-->)
|
||||
function get_extended($post) {
|
||||
list($main,$extended) = explode('<!--more-->',$post);
|
||||
list($main,$extended) = explode('<!--more-->', $post, 2);
|
||||
|
||||
// Strip leading and trailing whitespace
|
||||
$main = preg_replace('/^[\s]*(.*)[\s]*$/','\\1',$main);
|
||||
|
Loading…
Reference in New Issue
Block a user