Ticket #10948: 10948.3.diff
File 10948.3.diff, 3.1 KB (added by , 11 years ago) |
---|
-
wp-includes/comment-template.php
1510 1510 case 'div': 1511 1511 break; 1512 1512 case 'ol': 1513 echo'<ol class="children">' . "\n";1513 $output .= '<ol class="children">' . "\n"; 1514 1514 break; 1515 1515 default: 1516 1516 case 'ul': 1517 echo'<ul class="children">' . "\n";1517 $output .= '<ul class="children">' . "\n"; 1518 1518 break; 1519 1519 } 1520 1520 } … … 1537 1537 case 'div': 1538 1538 break; 1539 1539 case 'ol': 1540 echo"</ol><!-- .children -->\n";1540 $output .= "</ol><!-- .children -->\n"; 1541 1541 break; 1542 1542 default: 1543 1543 case 'ul': 1544 echo"</ul><!-- .children -->\n";1544 $output .= "</ul><!-- .children -->\n"; 1545 1545 break; 1546 1546 } 1547 1547 } … … 1616 1616 $GLOBALS['comment'] = $comment; 1617 1617 1618 1618 if ( !empty( $args['callback'] ) ) { 1619 ob_start(); 1619 1620 call_user_func( $args['callback'], $comment, $args, $depth ); 1621 $output .= ob_get_clean(); 1620 1622 return; 1621 1623 } 1622 1624 1623 1625 if ( ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) && $args['short_ping'] ) { 1626 ob_start(); 1624 1627 $this->ping( $comment, $depth, $args ); 1628 $output .= ob_get_clean(); 1625 1629 } elseif ( 'html5' === $args['format'] ) { 1630 ob_start(); 1626 1631 $this->html5_comment( $comment, $depth, $args ); 1632 $output .= ob_get_clean(); 1627 1633 } else { 1634 ob_start(); 1628 1635 $this->comment( $comment, $depth, $args ); 1636 $output .= ob_get_clean(); 1629 1637 } 1630 1638 } 1631 1639 … … 1643 1651 */ 1644 1652 function end_el( &$output, $comment, $depth = 0, $args = array() ) { 1645 1653 if ( !empty( $args['end-callback'] ) ) { 1654 ob_start(); 1646 1655 call_user_func( $args['end-callback'], $comment, $args, $depth ); 1656 $output .= ob_get_clean(); 1647 1657 return; 1648 1658 } 1649 1659 if ( 'div' == $args['style'] ) 1650 echo"</div><!-- #comment-## -->\n";1660 $output .= "</div><!-- #comment-## -->\n"; 1651 1661 else 1652 echo"</li><!-- #comment-## -->\n";1662 $output .= "</li><!-- #comment-## -->\n"; 1653 1663 } 1654 1664 1655 1665 /** … … 1794 1804 * @type string 'format' How to format the comments list. 1795 1805 * Default 'html5' if the theme supports it. Accepts 'html5', 'xhtml'. 1796 1806 * @type bool 'short_ping' Whether to output short pings. Default false. 1807 * @type bool 'echo' Whether to echo the output or return it. Default true. 1797 1808 * } 1798 1809 * @param array $comments Optional. Array of comment objects. @see WP_Query->comments 1799 1810 */ … … 1819 1830 'reverse_children' => '', 1820 1831 'format' => current_theme_supports( 'html5', 'comment-list' ) ? 'html5' : 'xhtml', 1821 1832 'short_ping' => false, 1833 'echo' => true, 1822 1834 ); 1823 1835 1824 1836 $r = wp_parse_args( $args, $defaults ); … … 1887 1899 if ( empty($walker) ) 1888 1900 $walker = new Walker_Comment; 1889 1901 1890 $ walker->paged_walk($_comments, $max_depth, $page, $per_page, $r);1902 $output = $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r); 1891 1903 $wp_query->max_num_comment_pages = $walker->max_pages; 1892 1904 1893 1905 $in_comment_loop = false; 1906 1907 if ( $r['echo'] ) 1908 echo $output; 1909 else 1910 return $output; 1894 1911 } 1895 1912 1896 1913 /**