Filter hook 'get_page_uri'

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

View Source

get_page_uri

Filter Hook
Description
Filters the URI for a page.

Hook Information

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

Hook Parameters

Type Name Description
string $uri Page URI.
WP_Post $page Page object.

Usage Examples

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

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

Source Code Context

wp-includes/post.php:6281 - How this hook is used in WordPress core
<?php
6276  	 * @since 4.4.0
6277  	 *
6278  	 * @param string  $uri  Page URI.
6279  	 * @param WP_Post $page Page object.
6280  	 */
6281  	return apply_filters( 'get_page_uri', $uri, $page );
6282  }
6283  
6284  /**
6285   * Retrieves an array of pages (or hierarchical post type items).
6286   *

PHP Documentation

<?php
/**
	 * Filters the URI for a page.
	 *
	 * @since 4.4.0
	 *
	 * @param string  $uri  Page URI.
	 * @param WP_Post $page Page object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.