Make WordPress Core

Ticket #14740: args.14740.diff

File args.14740.diff, 1.4 KB (added by scribu, 14 years ago)
  • wp-includes/taxonomy.php

     
    27942794        $r = wp_parse_args( $args, $defaults );
    27952795        extract( $r, EXTR_SKIP );
    27962796
    2797         echo $before . join($sep, get_the_taxonomies($post, $template)) . $after;
     2797        echo $before . join($sep, get_the_taxonomies($r)) . $after;
    27982798}
    27992799
    28002800/**
     
    28022802 *
    28032803 * This function can be used within the loop. It will also return an array of
    28042804 * the taxonomies with links to the taxonomy and name.
     2805
     2806 * The available defaults are:
     2807 * 'post' : default is 0. The post ID to get taxonomies of.
     2808 * 'template' : The template to use for displaying the taxonomy terms.
    28052809 *
    28062810 * @since 2.5.0
    28072811 *
    2808  * @param int $post Optional. Post ID or will use Global Post ID (in loop).
    2809  * @param string $template Optional. The template to use for displaying the taxonomy terms.
     2812 * @param array $args Override the defaults.
    28102813 * @return array
    28112814 */
    2812 function get_the_taxonomies($post = 0, $template = '%s: %l.') {
     2815function get_the_taxonomies( $args = array() ) {
     2816        if ( !is_array( $args ) ) {
     2817                $args = array( 'post' => $args );
     2818        }
     2819
     2820        $defaults = array(
     2821                'post' => 0,
     2822                'template' => '%s: %l.'
     2823        );
     2824
     2825        $r = wp_parse_args( $args, $defaults );
     2826        extract( $r, EXTR_SKIP );
     2827
    28132828        if ( is_int($post) )
    28142829                $post =& get_post($post);
    28152830        elseif ( !is_object($post) )