get_the_guid
Filters the Global Unique Identifier (guid) of the post.
Использование
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(строка)
- Global Unique Identifier (guid) of the post.
- $post_id(int)
- The post ID.
Список изменений
С версии 1.5.0 | Введена. |
Где вызывается хук
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 615
'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1796
'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),