WordPress.org

Make WordPress Core

Ticket #20072: 20072.2.diff

File 20072.2.diff, 2.1 KB (added by duck_, 6 years ago)
  • wp-includes/category-template.php

     
    995995 * @param string $before Optional. Before tags.
    996996 * @param string $sep Optional. Between tags.
    997997 * @param string $after Optional. After tags.
     998 * @param int $id Optional. Post ID. Defaults to the current post.
    998999 * @return string
    9991000 */
    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);
     1001function 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 );
    10021003}
    10031004
    10041005/**
     
    10531054 *
    10541055 * @since 2.5.0
    10551056 *
    1056  * @param int $id Post ID. Is not optional.
     1057 * @param int $id Post ID.
    10571058 * @param string $taxonomy Taxonomy name.
    10581059 * @return array|bool False on failure. Array of term objects on success.
    10591060 */
    1060 function get_the_terms( $id = 0, $taxonomy ) {
     1061function get_the_terms( $id, $taxonomy ) {
    10611062        global $post;
    10621063
    10631064        $id = (int) $id;
    10641065
    10651066        if ( !$id ) {
    1066                 if ( !$post->ID )
     1067                if ( empty( $post->ID ) )
    10671068                        return false;
    10681069                else
    10691070                        $id = (int) $post->ID;
     
    10951096 * @param string $after Optional. After list.
    10961097 * @return string
    10971098 */
    1098 function get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '' ) {
     1099function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '' ) {
    10991100        $terms = get_the_terms( $id, $taxonomy );
    11001101
    11011102        if ( is_wp_error( $terms ) )
     
    11281129 * @param string $after Optional. After list.
    11291130 * @return null|bool False on WordPress error. Returns null when displaying.
    11301131 */
    1131 function the_terms( $id = 0, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
     1132function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
    11321133        $term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
    11331134
    11341135        if ( is_wp_error( $term_list ) )