Ticket #20072: 20072.2.diff
| File 20072.2.diff, 2.1 KB (added by duck_, 13 months ago) |
|---|
-
wp-includes/category-template.php
995 995 * @param string $before Optional. Before tags. 996 996 * @param string $sep Optional. Between tags. 997 997 * @param string $after Optional. After tags. 998 * @param int $id Optional. Post ID. Defaults to the current post. 998 999 * @return string 999 1000 */ 1000 function get_the_tag_list( $before = '', $sep = '', $after = '' ) {1001 return apply_filters( 'the_tags', get_the_term_list( 0, 'post_tag', $before, $sep, $after ), $before, $sep, $after);1001 function get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 ) { 1002 return apply_filters( 'the_tags', get_the_term_list( $id, 'post_tag', $before, $sep, $after ), $before, $sep, $after, $id ); 1002 1003 } 1003 1004 1004 1005 /** … … 1053 1054 * 1054 1055 * @since 2.5.0 1055 1056 * 1056 * @param int $id Post ID. Is not optional.1057 * @param int $id Post ID. 1057 1058 * @param string $taxonomy Taxonomy name. 1058 1059 * @return array|bool False on failure. Array of term objects on success. 1059 1060 */ 1060 function get_the_terms( $id = 0, $taxonomy ) {1061 function get_the_terms( $id, $taxonomy ) { 1061 1062 global $post; 1062 1063 1063 1064 $id = (int) $id; 1064 1065 1065 1066 if ( !$id ) { 1066 if ( !$post->ID)1067 if ( empty( $post->ID ) ) 1067 1068 return false; 1068 1069 else 1069 1070 $id = (int) $post->ID; … … 1095 1096 * @param string $after Optional. After list. 1096 1097 * @return string 1097 1098 */ 1098 function get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '' ) {1099 function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '' ) { 1099 1100 $terms = get_the_terms( $id, $taxonomy ); 1100 1101 1101 1102 if ( is_wp_error( $terms ) ) … … 1128 1129 * @param string $after Optional. After list. 1129 1130 * @return null|bool False on WordPress error. Returns null when displaying. 1130 1131 */ 1131 function the_terms( $id = 0, $taxonomy, $before = '', $sep = ', ', $after = '' ) {1132 function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) { 1132 1133 $term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after ); 1133 1134 1134 1135 if ( is_wp_error( $term_list ) )
