Changeset 8892 for trunk/wp-includes/comment.php
- Timestamp:
- 09/15/2008 04:26:37 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r8833 r8892 1407 1407 } 1408 1408 1409 // 1410 // Internal 1411 // 1412 1413 /** 1414 * Close comments on old posts on the fly, without any extra DB queries. 1415 * 1416 * @since 2.7 1417 * @package WordPress 1418 * @subpackage Internal 1419 */ 1420 function _close_comments_for_old_posts( $posts ) { 1421 if ( !is_single() || !get_option('close_comments_for_old_posts') ) 1422 return $posts; 1423 1424 $days_old = (int) get_option('close_comments_days_old'); 1425 if ( !$days_old ) 1426 return $posts; 1427 1428 if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) { 1429 $posts[0]->comment_status = 'closed'; 1430 $posts[0]->ping_status = 'closed'; 1431 } 1432 1433 return $posts; 1434 } 1435 1409 1436 ?>
Note: See TracChangeset
for help on using the changeset viewer.