Taxonomy: in `wp_list_categories()`, add an arg: `separator`, to allow the overriding of `<br/>`.
Props wojtek.szkutnik. Fixes #9025. Built from https://develop.svn.wordpress.org/trunk@35140 git-svn-id: http://core.svn.wordpress.org/trunk@35105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
45a0c26091
commit
296671abcc
|
@ -474,7 +474,7 @@ function wp_dropdown_categories( $args = '' ) {
|
||||||
* Display or retrieve the HTML list of categories.
|
* Display or retrieve the HTML list of categories.
|
||||||
*
|
*
|
||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
* @since 4.4.0 Introduced the `hide_title_if_empty` argument. The `current_category` argument was modified to
|
* @since 4.4.0 Introduced the `hide_title_if_empty` and `separator` arguments. The `current_category` argument was modified to
|
||||||
* optionally accept an array of values.
|
* optionally accept an array of values.
|
||||||
*
|
*
|
||||||
* @param string|array $args {
|
* @param string|array $args {
|
||||||
|
@ -530,6 +530,7 @@ function wp_list_categories( $args = '' ) {
|
||||||
'hierarchical' => true, 'title_li' => __( 'Categories' ),
|
'hierarchical' => true, 'title_li' => __( 'Categories' ),
|
||||||
'hide_title_if_empty' => false,
|
'hide_title_if_empty' => false,
|
||||||
'echo' => 1, 'depth' => 0,
|
'echo' => 1, 'depth' => 0,
|
||||||
|
'separator' => '<br />',
|
||||||
'taxonomy' => 'category'
|
'taxonomy' => 'category'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -189,6 +189,8 @@ class Walker_Category extends Walker {
|
||||||
|
|
||||||
$output .= ' class="' . $css_classes . '"';
|
$output .= ' class="' . $css_classes . '"';
|
||||||
$output .= ">$link\n";
|
$output .= ">$link\n";
|
||||||
|
} elseif ( isset( $args['separator'] ) ) {
|
||||||
|
$output .= "\t$link" . $args['separator'] . "\n";
|
||||||
} else {
|
} else {
|
||||||
$output .= "\t$link<br />\n";
|
$output .= "\t$link<br />\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-35139';
|
$wp_version = '4.4-alpha-35140';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue