WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/25/2014 06:39:26 PM (7 years ago)
Author:
wonderboymusic
Message:

Popular tags' edit links should respect the current post type. Adds unit test.

Props mordauk, fahmiadib.
Fixes #25566.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/category-template.php

    r27709 r27720  
    572572 * of the posts with that tag returns a text for the tooltip of the tag link.
    573573 *
     574 * The 'post_type' argument is used only when 'link' is set to 'edit'. It determines the post_type
     575 * passed to edit.php for the popular tags edit links.
     576 *
    574577 * The 'exclude' and 'include' arguments are used for the {@link get_tags()}
    575578 * function. Only one should be used, because only one will be used and the
     
    585588        'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
    586589        'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',
    587         'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true
     590        'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'post_type' => '', 'echo' => true
    588591    );
    589592    $args = wp_parse_args( $args, $defaults );
     
    596599    foreach ( $tags as $key => $tag ) {
    597600        if ( 'edit' == $args['link'] )
    598             $link = get_edit_tag_link( $tag->term_id, $tag->taxonomy );
     601            $link = get_edit_term_link( $tag->term_id, $tag->taxonomy, $args['post_type'] );
    599602        else
    600603            $link = get_term_link( intval($tag->term_id), $tag->taxonomy );
Note: See TracChangeset for help on using the changeset viewer.