get_the_guid хук-фильтрWP 1.5.0

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 $guid Global Unique Identifier (guid) of the post.
 * @param int    $id   The post ID.
 *
 * @return string
 */
function wp_kama_get_the_guid_filter( $guid, $id ){

	// filter...
	return $guid;
}
$guid(строка)
Global Unique Identifier (guid) of the post.
$id(int)
The post ID.

Список изменений

С версии 1.5.0 Введена.

Где вызывается хук

get_the_guid()
get_the_guid
WP_REST_Revisions_Controller::prepare_item_for_response()
get_the_guid
WP_REST_Posts_Controller::prepare_item_for_response()
get_the_guid
wp-includes/post-template.php 232
return apply_filters( 'get_the_guid', $guid, $id );
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php 589
'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1736
'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),

Где используется хук в WordPress

Использование не найдено.