Archive for December, 2008


WordPress Tip: Change Scheduled Post Date Information

WordPress 2.7 is a whole lot of good. Snappier and (to me) better designed UI. However, there is one aspect of the UI that has a few irritated (perhaps irriated is too strong a word). Not a critical thing, but still something they’d like changed. What is the issue? When looking at the publish date for future/scheduled posts, instead of the normal date on when it will be shown (e.g. 2009/1/25) the user is presented with how many days from the current date the post will be published (e.g. 37 days from now).

Future Posts - Days From Now

So, I’ve taken a gander and came up with the following solution. It may not be the best (and for anyone sketchy about editing code, a little concerning), but it’s fast and easy.

There are two lines in wp-admin/includes/template.php that effect the date display. If you have any text editing/coding program, you should be able to go to the lines 1342 and 1552. If anything, a search for “$h_time = sprintf( __(‘%s from now’), human_time_diff( $time ) );” (without quotes) will do the trick. Now, you can replace that exact text with “$h_time = mysql2date(__(‘Y/m/d’), $m_time);” (without quotes) and that’s it! Save and upload the modified file. If you’re sketchy about replacing the line, you can comment it out as I did.

Future Posts - code edit line 1341line 1341

Future Posts - code edit line 1552
line 1552

And once you’re done and uploaded, you can see your results when you refresh the page.

Future Posts - Date

If you would like to put the “from now” information on the tooltip when hovering your mouse cursor over the date, you can add the code chunk in the screenshot below to line 1361.

Future Posts - code edit line 1361
line 1361