Bulk edit post date in wordpress

Original source : post date Create admin-script.js at your current theme ( this use js folder ) jQuery(document).ready(function($){ $(‘.inline-edit-col-right .inline-edit-col’) .append( ‘<label style=”margin-top: 3em;”><span class=”title”>Date</span>’ + ‘<div class=”timestamp-wrap”><select name=”mm”>’ + ‘<option value=”00″>Month</option>’ + ‘<option value=”01″>01-January</option>’ + ‘<option value=”02″>02-February</option>’ + ‘<option value=”03″>03-March</option>’ + ‘<option value=”04″>04-April</option>’ + ‘<option value=”05″>05-May</option>’ + ‘<option value=”06″>06-June</option>’ + ‘<option value=”07″>07-July</option>’ + ‘<option … Read more

XML export posts from one single day

Enhance the native XML export – with a single day selection Here’s one way to modify the native export with a select box, with all available days: Here we assume that there are not “huge” number of days to select from 😉 Otherwise we could use a different kind of user interface. Step #1 First … Read more

Modify Date Format to German

WordPress has a special function for translating dates, called date_i18n. General usage: echo date_i18n( $dateformatstring, $unixtimestamp, $gmt); Supposing you have German as your site’s language this would be: echo date_i18n( ‘j. F Y’, false, false); You can also import the time format from the admin settings, like this: echo date_i18n(get_option(‘date_format’), false, false);

Date comparison : which date format?

The date format for entering the date is largely irrelevant. strtotime will convert a lot of different formats to UNIX time. Just make sure your input format makes sense to your users and make sure that your feed strtottime a format that correctly converts to UNIX time. If you are storing data in the *_postmeta … Read more

Keeping post_date same as the pending post_date on privately publishing the post

@Howdy_McGee is on the right track in his comment: by the time transition_post_status is fired, the post has already been updated (i.e., written to the db). What you need to do is hook into wp_insert_post_data, instead of transition_post_status, as follows: add_filter (‘wp_insert_post_data’, ‘mycpt_keep_pending_date_on_publishing’, 10, 2) ; function mycpt_keep_pending_date_on_publishing ($data, $postarr) { if ($data[‘post_type’] != ‘mycpt’) … Read more

How to integrate get_post_time with date_i18n function?

Use the fourth parameter for get_post_time(): $time = get_post_time( ‘F j, Y’, // format TRUE, // GMT get_the_ID(), // Post ID TRUE // translate, use date_i18n() ); get_post_time() calls mysql2date() internally, and it passes the $translate argument through. In mysql2date() we find this: if ( $translate ) return date_i18n( $format, $i ); So, all you … Read more