Better date editing from MarkJaquith. see #6250

git-svn-id: https://develop.svn.wordpress.org/trunk@7338 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-03-16 23:05:16 +00:00
parent fff82c1684
commit 56a7acdf15
6 changed files with 60 additions and 19 deletions

View File

@@ -74,6 +74,13 @@ function edit_post() {
if (!isset( $_POST['ping_status'] ))
$_POST['ping_status'] = 'closed';
foreach ( array ('aa', 'mm', 'jj', 'hh', 'mm') as $timeunit ) {
if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
$_POST['edit_date'] = '1';
break;
}
}
if (!empty ( $_POST['edit_date'] ) ) {
$aa = $_POST['aa'];
$mm = $_POST['mm'];
@@ -281,6 +288,13 @@ function wp_write_post() {
if (!isset( $_POST['ping_status'] ))
$_POST['ping_status'] = 'closed';
foreach ( array ('aa', 'mm', 'jj', 'hh', 'mm') as $timeunit ) {
if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
$_POST['edit_date'] = '1';
break;
}
}
if (!empty ( $_POST['edit_date'] ) ) {
$aa = $_POST['aa'];
$mm = $_POST['mm'];