Filter hook 'list_pages'

in WP Core File wp-includes/class-walker-page-dropdown.php at line 92

View Source

list_pages

Filter Hook
Description
Filters the page title when creating an HTML drop-down list of pages.

Hook Information

File Location wp-includes/class-walker-page-dropdown.php View on GitHub
Hook Type Filter
Line Number 92

Hook Parameters

Type Name Description
string $title Page title.
WP_Post $page Page data object.

Usage Examples

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

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

Source Code Context

wp-includes/class-walker-page-dropdown.php:92 - How this hook is used in WordPress core
<?php
  87  		 * @since 3.1.0
  88  		 *
  89  		 * @param string  $title Page title.
  90  		 * @param WP_Post $page  Page data object.
  91  		 */
  92  		$title = apply_filters( 'list_pages', $title, $page );
  93  
  94  		$output .= $pad . esc_html( $title );
  95  		$output .= "</option>\n";
  96  	}
  97  }

PHP Documentation

<?php
/**
		 * Filters the page title when creating an HTML drop-down list of pages.
		 *
		 * @since 3.1.0
		 *
		 * @param string  $title Page title.
		 * @param WP_Post $page  Page data object.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-walker-page-dropdown.php
Related Hooks

Related hooks will be displayed here in future updates.