widget_pages_args filter-hookWP 2.8.0

Filters the arguments for the Pages widget.

Usage

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(array)
An array of arguments to retrieve the pages list.
$instance(array)
Array of settings for the current widget.

Changelog

Since 2.8.0 Introduced.
Since 4.9.0 Added the $instance parameter.

Where the hook is called

WP_Widget_Pages::widget()
widget_pages_args
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
)

Where the hook is used in WordPress

Usage not found.