Make WordPress Core

Ticket #18109: 18109.diff

File 18109.diff, 1.6 KB (added by kawauso, 14 years ago)

Use the query object method instead

  • wp-includes/comment.php

     
    19591959 * @since 2.7.0
    19601960 *
    19611961 * @param object $posts Post data object.
     1962 * @param object $query Query object.
    19621963 * @return object
    19631964 */
    1964 function _close_comments_for_old_posts( $posts ) {
    1965         if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') )
     1965function _close_comments_for_old_posts( $posts, $query ) {
     1966        if ( empty($posts) || !$query->is_singular() || !get_option('close_comments_for_old_posts') )
    19661967                return $posts;
    19671968
    19681969        $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
  • wp-includes/default-filters.php

     
    189189add_filter( 'comment_email',        'antispambot'                         );
    190190add_filter( 'option_tag_base',      '_wp_filter_taxonomy_base'            );
    191191add_filter( 'option_category_base', '_wp_filter_taxonomy_base'            );
    192 add_filter( 'the_posts',            '_close_comments_for_old_posts'      );
     192add_filter( 'the_posts',            '_close_comments_for_old_posts', 10, 2 );
    193193add_filter( 'comments_open',        '_close_comments_for_old_post', 10, 2 );
    194194add_filter( 'pings_open',           '_close_comments_for_old_post', 10, 2 );
    195195add_filter( 'editable_slug',        'urldecode'                           );