Filter hook 'widget_pages_args'

in WP Core File wp-includes/widgets/class-wp-widget-pages.php at line 77

View Source

widget_pages_args

Filter Hook
Description
Filters the arguments for the Pages widget.

Hook Information

File Location wp-includes/widgets/class-wp-widget-pages.php View on GitHub
Hook Type Filter
Line Number 77

Hook Parameters

Type Name Description
array $args An array of arguments to retrieve the pages list.
array $instance Array of settings for the current widget.

Usage Examples

Basic Usage
<?php
// Hook into widget_pages_args
add_filter('widget_pages_args', 'my_custom_filter', 10, 2);

function my_custom_filter($args, $instance) {
    // Your custom filtering logic here
    return $args;
}

Source Code Context

wp-includes/widgets/class-wp-widget-pages.php:77 - How this hook is used in WordPress core
<?php
  72  			 * @see wp_list_pages()
  73  			 *
  74  			 * @param array $args     An array of arguments to retrieve the pages list.
  75  			 * @param array $instance Array of settings for the current widget.
  76  			 */
  77  			apply_filters(
  78  				'widget_pages_args',
  79  				array(
  80  					'title_li'    => '',
  81  					'echo'        => 0,
  82  					'sort_column' => $sortby,

PHP Documentation

<?php
/**
			 * Filters the arguments for the Pages widget.
			 *
			 * @since 2.8.0
			 * @since 4.9.0 Added the `$instance` parameter.
			 *
			 * @see wp_list_pages()
			 *
			 * @param array $args     An array of arguments to retrieve the pages list.
			 * @param array $instance Array of settings for the current widget.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/widgets/class-wp-widget-pages.php
Related Hooks

Related hooks will be displayed here in future updates.