the_guid
Filters the escaped Global Unique Identifier (guid) of the post.
Usage
add_filter( 'the_guid', 'wp_kama_the_guid_filter', 10, 2 );
/**
* Function for `the_guid` filter-hook.
*
* @param string $post_guid Escaped Global Unique Identifier (guid) of the post.
* @param int $post_id The post ID.
*
* @return string
*/
function wp_kama_the_guid_filter( $post_guid, $post_id ){
// filter...
return $post_guid;
}
- $post_guid(string)
- Escaped Global Unique Identifier (guid) of the post.
- $post_id(int)
- The post ID.
Changelog
| Since 4.2.0 | Introduced. |
Where the hook is called
the_guid
wp-includes/post-template.php 206
echo apply_filters( 'the_guid', $post_guid, $post_id );
Where the hook is used in WordPress
wp-includes/default-filters.php 271
add_filter( 'the_guid', 'esc_url' );