WordPress.org

Make WordPress Core

Ticket #14156: 14156.patch

File 14156.patch, 956 bytes (added by mordauk, 5 years ago)
  • src/wp-includes/taxonomy.php

     
    43224322 *
    43234323 * @param object|int|string $term     The term object, ID, or slug whose link will be retrieved.
    43244324 * @param string            $taxonomy Optional. Taxonomy. Default empty.
     4325 * @param string $field Either 'slug', 'name', or 'id'
    43254326 * @return string|WP_Error HTML link to taxonomy term archive on success, WP_Error if term does not exist.
    43264327 */
    4327 function get_term_link( $term, $taxonomy = '') {
     4328function get_term_link( $term, $taxonomy = '', $field = 'slug' ) {
    43284329        global $wp_rewrite;
    43294330
    43304331        if ( !is_object($term) ) {
     
    43314332                if ( is_int($term) ) {
    43324333                        $term = get_term($term, $taxonomy);
    43334334                } else {
    4334                         $term = get_term_by('slug', $term, $taxonomy);
     4335                        $term = get_term_by( $field, $term, $taxonomy );
    43354336                }
    43364337        }
    43374338