wp/wp-includes/class-walker-category-dropdown.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 18 be944660c56a
--- a/wp/wp-includes/class-walker-category-dropdown.php	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-includes/class-walker-category-dropdown.php	Mon Oct 14 18:28:13 2019 +0200
@@ -35,7 +35,10 @@
 	 *
 	 * @see Walker::$db_fields
 	 */
-	public $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
+	public $db_fields = array(
+		'parent' => 'parent',
+		'id'     => 'term_id',
+	);
 
 	/**
 	 * Starts the element output.
@@ -52,7 +55,7 @@
 	 * @param int    $id       Optional. ID of the current category. Default 0 (unused).
 	 */
 	public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
-		$pad = str_repeat(' ', $depth * 3);
+		$pad = str_repeat( ' ', $depth * 3 );
 
 		/** This filter is documented in wp-includes/category-template.php */
 		$cat_name = apply_filters( 'list_cats', $category->name, $category );
@@ -63,15 +66,17 @@
 			$value_field = 'term_id';
 		}
 
-		$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . "\"";
+		$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . '"';
 
 		// Type-juggling causes false matches, so we force everything to a string.
-		if ( (string) $category->{$value_field} === (string) $args['selected'] )
+		if ( (string) $category->{$value_field} === (string) $args['selected'] ) {
 			$output .= ' selected="selected"';
+		}
 		$output .= '>';
-		$output .= $pad.$cat_name;
-		if ( $args['show_count'] )
-			$output .= '&nbsp;&nbsp;('. number_format_i18n( $category->count ) .')';
+		$output .= $pad . $cat_name;
+		if ( $args['show_count'] ) {
+			$output .= '&nbsp;&nbsp;(' . number_format_i18n( $category->count ) . ')';
+		}
 		$output .= "</option>\n";
 	}
 }