wp/wp-includes/class-walker-category.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    87 	 *
    87 	 *
    88 	 * @since 2.1.0
    88 	 * @since 2.1.0
    89 	 *
    89 	 *
    90 	 * @see Walker::start_el()
    90 	 * @see Walker::start_el()
    91 	 *
    91 	 *
    92 	 * @param string $output   Used to append additional content (passed by reference).
    92 	 * @param string  $output   Used to append additional content (passed by reference).
    93 	 * @param object $category Category data object.
    93 	 * @param WP_Term $category Category data object.
    94 	 * @param int    $depth    Optional. Depth of category in reference to parents. Default 0.
    94 	 * @param int     $depth    Optional. Depth of category in reference to parents. Default 0.
    95 	 * @param array  $args     Optional. An array of arguments. See wp_list_categories(). Default empty array.
    95 	 * @param array   $args     Optional. An array of arguments. See wp_list_categories(). Default empty array.
    96 	 * @param int    $id       Optional. ID of the current category. Default 0.
    96 	 * @param int     $id       Optional. ID of the current category. Default 0.
    97 	 */
    97 	 */
    98 	public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
    98 	public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
    99 		/** This filter is documented in wp-includes/category-template.php */
    99 		/** This filter is documented in wp-includes/category-template.php */
   100 		$cat_name = apply_filters( 'list_cats', esc_attr( $category->name ), $category );
   100 		$cat_name = apply_filters( 'list_cats', esc_attr( $category->name ), $category );
   101 
   101 
   111 			/**
   111 			/**
   112 			 * Filters the category description for display.
   112 			 * Filters the category description for display.
   113 			 *
   113 			 *
   114 			 * @since 1.2.0
   114 			 * @since 1.2.0
   115 			 *
   115 			 *
   116 			 * @param string $description Category description.
   116 			 * @param string  $description Category description.
   117 			 * @param object $category    Category object.
   117 			 * @param WP_Term $category    Category object.
   118 			 */
   118 			 */
   119 			$atts['title'] = strip_tags( apply_filters( 'category_description', $category->description, $category ) );
   119 			$atts['title'] = strip_tags( apply_filters( 'category_description', $category->description, $category ) );
   120 		}
   120 		}
   121 
   121 
   122 		/**
   122 		/**
   225 			 *
   225 			 *
   226 			 * @since 4.2.0
   226 			 * @since 4.2.0
   227 			 *
   227 			 *
   228 			 * @see wp_list_categories()
   228 			 * @see wp_list_categories()
   229 			 *
   229 			 *
   230 			 * @param array  $css_classes An array of CSS classes to be applied to each list item.
   230 			 * @param string[] $css_classes An array of CSS classes to be applied to each list item.
   231 			 * @param object $category    Category data object.
   231 			 * @param WP_Term  $category    Category data object.
   232 			 * @param int    $depth       Depth of page, used for padding.
   232 			 * @param int      $depth       Depth of page, used for padding.
   233 			 * @param array  $args        An array of wp_list_categories() arguments.
   233 			 * @param array    $args        An array of wp_list_categories() arguments.
   234 			 */
   234 			 */
   235 			$css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) );
   235 			$css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) );
   236 			$css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : '';
   236 			$css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : '';
   237 
   237 
   238 			$output .= $css_classes;
   238 			$output .= $css_classes;