Ticket #21758: comment-template.php.patch
File comment-template.php.patch, 1.8 KB (added by , 12 years ago) |
---|
-
comment-template.php
846 846 * 847 847 * @param string $file Optional, default '/comments.php'. The file to load 848 848 * @param bool $separate_comments Optional, whether to separate the comments by comment type. Default is false. 849 * @param bool $require Optional, whether to include a comment file. Default is true. 849 850 * @return null Returns null if no comments appear 850 851 */ 851 function comments_template( $file = '/comments.php', $separate_comments = false ) {852 function comments_template( $file = '/comments.php', $separate_comments = false, $require = true ) { 852 853 global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage; 853 854 854 855 if ( !(is_single() || is_page() || $withcomments) || empty($post) ) 855 856 return; 856 857 857 if ( empty($file) )858 $file = '/comments.php';859 860 858 $req = get_option('require_name_email'); 861 859 862 860 /** … … 909 907 910 908 if ( !defined('COMMENTS_TEMPLATE') ) 911 909 define('COMMENTS_TEMPLATE', true); 912 913 $include = apply_filters('comments_template', STYLESHEETPATH . $file ); 914 if ( file_exists( $include ) ) 915 require( $include ); 916 elseif ( file_exists( TEMPLATEPATH . $file ) ) 917 require( TEMPLATEPATH . $file ); 918 else // Backward compat code will be removed in a future release 919 require( ABSPATH . WPINC . '/theme-compat/comments.php'); 910 911 // require a comments.php file? 912 if ( $require !== false) { 913 if ( empty($file) ) 914 $file = '/comments.php'; 915 $include = apply_filters('comments_template', STYLESHEETPATH . $file ); 916 if ( file_exists( $include ) ) 917 require( $include ); 918 elseif ( file_exists( TEMPLATEPATH . $file ) ) 919 require( TEMPLATEPATH . $file ); 920 else // Backward compat code will be removed in a future release 921 require( ABSPATH . WPINC . '/theme-compat/comments.php'); 922 } 920 923 } 921 924 922 925 /**