wpseo_llmstxt_link_description
Filter wpseo_llmstxt_link_description Allow filtering the description of links in the llms.txt post lists.
Использование
add_filter( 'wpseo_llmstxt_link_description', 'wp_kama_wpseo_llmstxt_link_description_filter', 10, 3 );
/**
* Function for `wpseo_llmstxt_link_description` filter-hook.
*
* @param string $link_description The description of the link.
* @param string $post_id The ID of the post that is being added as a link.
* @param string $post_type The post type of the post that is being added as a link.
*
* @return string
*/
function wp_kama_wpseo_llmstxt_link_description_filter( $link_description, $post_id, $post_type ){
// filter...
return $link_description;
}
- $link_description(строка)
- The description of the link.
- $post_id(строка)
- The ID of the post that is being added as a link.
- $post_type(строка)
- The post type of the post that is being added as a link.
Список изменений
| С версии 26.3 | Введена. |
Где вызывается хук
wpseo_llmstxt_link_description
yoast/src/llms-txt/infrastructure/markdown-services/content-types-collector.php 91
$link_description = \apply_filters( 'wpseo_llmstxt_link_description', $post->get_description(), $post->get_id(), $post_type_object->name );