Make WordPress Core

Ticket #10600: the_terms.patch

File the_terms.patch, 877 bytes (added by scribu, 17 years ago)

Add 'the_terms' filter and set ', ' as default separator

  • wp-includes/category-template.php

     
    908908 * @param string $after Optional. After list.
    909909 * @return null|bool False on WordPress error. Returns null when displaying.
    910910 */
    911 function the_terms( $id, $taxonomy, $before = '', $sep = '', $after = '' ) {
    912         $return = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
    913         if ( is_wp_error( $return ) )
     911function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
     912        $term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
     913
     914        if ( is_wp_error( $term_list ) )
    914915                return false;
    915         else
    916                 echo $return;
     916
     917        echo apply_filters('the_terms', $term_list, $taxonomy, $before, $sep, $after);
    917918}
    918919
    919920/**