Make get_the_taxonomies() take an array of arguments. props scribu, fixes #14740.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
01c718f85f
commit
300bee4a8d
|
@ -2889,7 +2889,7 @@ function the_taxonomies($args = array()) {
|
||||||
$r = wp_parse_args( $args, $defaults );
|
$r = wp_parse_args( $args, $defaults );
|
||||||
extract( $r, EXTR_SKIP );
|
extract( $r, EXTR_SKIP );
|
||||||
|
|
||||||
echo $before . join($sep, get_the_taxonomies($post, $template)) . $after;
|
echo $before . join($sep, get_the_taxonomies($post, $r)) . $after;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2901,15 +2901,20 @@ function the_taxonomies($args = array()) {
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*
|
*
|
||||||
* @param int $post Optional. Post ID or will use Global Post ID (in loop).
|
* @param int $post Optional. Post ID or will use Global Post ID (in loop).
|
||||||
* @param string $template Optional. The template to use for displaying the taxonomy terms.
|
* @param array $args Override the defaults.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_the_taxonomies($post = 0, $template = '%s: %l.') {
|
function get_the_taxonomies($post = 0, $args = array() ) {
|
||||||
if ( is_int($post) )
|
if ( is_int($post) )
|
||||||
$post =& get_post($post);
|
$post =& get_post($post);
|
||||||
elseif ( !is_object($post) )
|
elseif ( !is_object($post) )
|
||||||
$post =& $GLOBALS['post'];
|
$post =& $GLOBALS['post'];
|
||||||
|
|
||||||
|
$args = wp_parse_args( $args, array(
|
||||||
|
'template' => '%s: %l.',
|
||||||
|
) );
|
||||||
|
extract( $args, EXTR_SKIP );
|
||||||
|
|
||||||
$taxonomies = array();
|
$taxonomies = array();
|
||||||
|
|
||||||
if ( !$post )
|
if ( !$post )
|
||||||
|
|
Loading…
Reference in New Issue