get_the_guid
Filters the Global Unique Identifier (guid) of the post.
Usage
add_filter( 'get_the_guid', 'wp_kama_get_the_guid_filter', 10, 2 );
/**
* Function for `get_the_guid` filter-hook.
*
* @param string $post_guid Global Unique Identifier (guid) of the post.
* @param int $post_id The post ID.
*
* @return string
*/
function wp_kama_get_the_guid_filter( $post_guid, $post_id ){
// filter...
return $post_guid;
}
- $post_guid(string)
- Global Unique Identifier (guid) of the post.
- $post_id(int)
- The post ID.
Changelog
| Since 1.5.0 | Introduced. |
Where the hook is called
get_the_guid
get_the_guid
wp-includes/post-template.php 235
return apply_filters( 'get_the_guid', $post_guid, $post_id );
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php 659
$data['guid']['rendered'] = apply_filters( 'get_the_guid', $post->guid, $post->ID );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1930
'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),