Ticket #5801: 755_future_posts_wporg.diff
| File 755_future_posts_wporg.diff, 1.8 kB (added by hailin, 10 months ago) |
|---|
-
C:/xampp/htdocs/wordpress_trunk/wp-includes/default-filters.php
old new 153 153 add_action('wp_head', 'rsd_link'); 154 154 add_action('wp_head', 'wlwmanifest_link'); 155 155 add_action('wp_head', 'locale_stylesheet'); 156 add_action('publish_future_post', ' wp_publish_post', 10, 1);156 add_action('publish_future_post', 'check_and_publish_future_post', 10, 1); 157 157 add_action('wp_head', 'noindex', 1); 158 158 add_action('wp_head', 'wp_print_scripts'); 159 159 add_action('wp_head', 'wp_generator'); -
C:/xampp/htdocs/wordpress_trunk/wp-includes/post.php
old new 1259 1259 do_action('wp_insert_post', $post_id, $post); 1260 1260 } 1261 1261 1262 /** 1263 * check_and_publish_future_post() - check to make sure post has correct status before 1264 * passing it on to be published. Invoked by cron 'publish_future_post' event 1265 * This safeguard prevents cron from publishing drafts, etc. 1266 * 1267 * {@internal Missing Long Description}} 1268 * 1269 * @package WordPress 1270 * @subpackage Post 1271 * @since 2.5 1272 * @uses $wpdb 1273 * 1274 * @param int $post_id Post ID 1275 * @return int|null {@internal Missing Description}} 1276 */ 1277 function check_and_publish_future_post($post_id) { 1278 1279 $post = get_post($post_id); 1280 1281 if ( empty($post) ) 1282 return; 1283 1284 if ( 'future' != $post->post_status ) 1285 return; 1286 1287 return wp_publish_post($post_id); 1288 } 1289 1262 1290 function wp_add_post_tags($post_id = 0, $tags = '') { 1263 1291 return wp_set_post_tags($post_id, $tags, true); 1264 1292 }
