Filter hook 'wp_list_pages_excludes'

in WP Core File wp-includes/post-template.php at line 1340

View Source

wp_list_pages_excludes

Filter Hook
Description
Filters the array of pages to exclude from the pages list.

Hook Information

File Location wp-includes/post-template.php View on GitHub
Hook Type Filter
Line Number 1340

Hook Parameters

Type Name Description
string[] $exclude_array An array of page IDs to exclude.

Usage Examples

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

function my_custom_filter($exclude_array) {
    // Your custom filtering logic here
    return $exclude_array;
}

Source Code Context

wp-includes/post-template.php:1340 - How this hook is used in WordPress core
<?php
1335  	 *
1336  	 * @since 2.1.0
1337  	 *
1338  	 * @param string[] $exclude_array An array of page IDs to exclude.
1339  	 */
1340  	$parsed_args['exclude'] = implode( ',', apply_filters( 'wp_list_pages_excludes', $exclude_array ) );
1341  
1342  	$parsed_args['hierarchical'] = 0;
1343  
1344  	// Query pages.
1345  	$pages = get_pages( $parsed_args );

PHP Documentation

<?php
/**
	 * Filters the array of pages to exclude from the pages list.
	 *
	 * @since 2.1.0
	 *
	 * @param string[] $exclude_array An array of page IDs to exclude.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/post-template.php
Related Hooks

Related hooks will be displayed here in future updates.