Update WP and plugins
This commit is contained in:
parent
10a4713229
commit
1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions
|
@ -35,7 +35,10 @@ class Walker_Category extends Walker {
|
|||
* @see Walker::$db_fields
|
||||
* @todo Decouple this
|
||||
*/
|
||||
public $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
|
||||
public $db_fields = array(
|
||||
'parent' => 'parent',
|
||||
'id' => 'term_id',
|
||||
);
|
||||
|
||||
/**
|
||||
* Starts the list before the elements are added.
|
||||
|
@ -50,10 +53,11 @@ class Walker_Category extends Walker {
|
|||
* value is 'list'. See wp_list_categories(). Default empty array.
|
||||
*/
|
||||
public function start_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
if ( 'list' != $args['style'] )
|
||||
if ( 'list' != $args['style'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$indent = str_repeat("\t", $depth);
|
||||
$indent = str_repeat( "\t", $depth );
|
||||
$output .= "$indent<ul class='children'>\n";
|
||||
}
|
||||
|
||||
|
@ -70,10 +74,11 @@ class Walker_Category extends Walker {
|
|||
* value is 'list'. See wp_list_categories(). Default empty array.
|
||||
*/
|
||||
public function end_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
if ( 'list' != $args['style'] )
|
||||
if ( 'list' != $args['style'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$indent = str_repeat("\t", $depth);
|
||||
$indent = str_repeat( "\t", $depth );
|
||||
$output .= "$indent</ul>\n";
|
||||
}
|
||||
|
||||
|
@ -129,10 +134,10 @@ class Walker_Category extends Walker {
|
|||
$link .= '<a href="' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $args['feed_type'] ) ) . '"';
|
||||
|
||||
if ( empty( $args['feed'] ) ) {
|
||||
$alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
|
||||
$alt = ' alt="' . sprintf( __( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
|
||||
} else {
|
||||
$alt = ' alt="' . $args['feed'] . '"';
|
||||
$name = $args['feed'];
|
||||
$alt = ' alt="' . $args['feed'] . '"';
|
||||
$name = $args['feed'];
|
||||
$link .= empty( $args['title'] ) ? '' : $args['title'];
|
||||
}
|
||||
|
||||
|
@ -141,7 +146,7 @@ class Walker_Category extends Walker {
|
|||
if ( empty( $args['feed_image'] ) ) {
|
||||
$link .= $name;
|
||||
} else {
|
||||
$link .= "<img src='" . $args['feed_image'] . "'$alt" . ' />';
|
||||
$link .= "<img src='" . esc_url( $args['feed_image'] ) . "'$alt" . ' />';
|
||||
}
|
||||
$link .= '</a>';
|
||||
|
||||
|
@ -154,7 +159,7 @@ class Walker_Category extends Walker {
|
|||
$link .= ' (' . number_format_i18n( $category->count ) . ')';
|
||||
}
|
||||
if ( 'list' == $args['style'] ) {
|
||||
$output .= "\t<li";
|
||||
$output .= "\t<li";
|
||||
$css_classes = array(
|
||||
'cat-item',
|
||||
'cat-item-' . $category->term_id,
|
||||
|
@ -162,10 +167,13 @@ class Walker_Category extends Walker {
|
|||
|
||||
if ( ! empty( $args['current_category'] ) ) {
|
||||
// 'current_category' can be an array, so we use `get_terms()`.
|
||||
$_current_terms = get_terms( $category->taxonomy, array(
|
||||
'include' => $args['current_category'],
|
||||
'hide_empty' => false,
|
||||
) );
|
||||
$_current_terms = get_terms(
|
||||
$category->taxonomy,
|
||||
array(
|
||||
'include' => $args['current_category'],
|
||||
'hide_empty' => false,
|
||||
)
|
||||
);
|
||||
|
||||
foreach ( $_current_terms as $_current_term ) {
|
||||
if ( $category->term_id == $_current_term->term_id ) {
|
||||
|
@ -175,7 +183,7 @@ class Walker_Category extends Walker {
|
|||
}
|
||||
while ( $_current_term->parent ) {
|
||||
if ( $category->term_id == $_current_term->parent ) {
|
||||
$css_classes[] = 'current-cat-ancestor';
|
||||
$css_classes[] = 'current-cat-ancestor';
|
||||
break;
|
||||
}
|
||||
$_current_term = get_term( $_current_term->parent, $category->taxonomy );
|
||||
|
@ -196,8 +204,9 @@ class Walker_Category extends Walker {
|
|||
* @param array $args An array of wp_list_categories() arguments.
|
||||
*/
|
||||
$css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) );
|
||||
$css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : '';
|
||||
|
||||
$output .= ' class="' . $css_classes . '"';
|
||||
$output .= $css_classes;
|
||||
$output .= ">$link\n";
|
||||
} elseif ( isset( $args['separator'] ) ) {
|
||||
$output .= "\t$link" . $args['separator'] . "\n";
|
||||
|
@ -220,8 +229,9 @@ class Walker_Category extends Walker {
|
|||
* to output. See wp_list_categories(). Default empty array.
|
||||
*/
|
||||
public function end_el( &$output, $page, $depth = 0, $args = array() ) {
|
||||
if ( 'list' != $args['style'] )
|
||||
if ( 'list' != $args['style'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$output .= "</li>\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue