page_css_class хук-фильтр . WP 2.8.0
Filters the list of CSS classes to include with each page item in the list.
Использование
add_filter( 'page_css_class', 'filter_function_name_5545', 10, 5 ); function filter_function_name_5545( $css_class, $page, $depth, $args, $current_page ){ // filter... return $css_class; }
- $css_class(строка[])
- An array of CSS classes to be applied to each list item.
- $page(WP_Post)
- Page data object.
- $depth(число)
- Depth of page, used for padding.
- $args(массив)
- An array of arguments.
- $current_page(число)
- ID of the current page.
Список изменений
С версии 2.8.0 | Введена. |
Где вызывается хук
wp-includes/class-walker-page.php 152
$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );