投稿が行われたら、Feedも更新する

新しい投稿が行われたら、フィードも更新する

functions.php

<?php
// delay feed update after posting
add_filter('posts_where', 'publish_later_on_feed');
function publish_later_on_feed($where) {
	global $wpdb;
	if (is_feed()) {
		// timestamp in WP-format
		$now= gmdate('Y-m-d H:i:s');

		// value for wait; + device
		$wait= '5'; // integer

		// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
		$device= 'MINUTE'; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

		// add SQL-sytax to default $where
		$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
	}
	return $where;
}?>

http://digwp.com/2012/10/customizing-wordpress-feeds/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+DiggingIntoWordpress+%28Digging+Into+WordPress%29(@source)

[emulsion_relate_posts]