widget_pages_args
Filters the arguments for the Pages widget.
Использование
add_filter( 'widget_pages_args', 'wp_kama_widget_pages_args_filter', 10, 2 ); /** * Function for `widget_pages_args` filter-hook. * * @param array $args An array of arguments to retrieve the pages list. * @param array $instance Array of settings for the current widget. * * @return array */ function wp_kama_widget_pages_args_filter( $args, $instance ){ // filter... return $args; }
- $args(массив)
- An array of arguments to retrieve the pages list.
- $instance(массив)
- Array of settings for the current widget.
Список изменений
С версии 2.8.0 | Введена. |
С версии 4.9.0 | Added the $instance parameter. |
Где вызывается хук
wp-includes/widgets/class-wp-widget-pages.php 77-86
apply_filters( 'widget_pages_args', array( 'title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude, ), $instance )