add_trashed_suffix_to_trashed_posts хук-фильтрWP 5.4.0

Filters whether or not to add a __trashed suffix to trashed posts that match the name of the updated post.

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

add_filter( 'add_trashed_suffix_to_trashed_posts', 'wp_kama_add_trashed_suffix_to_posts_filter', 10, 3 );

/**
 * Function for `add_trashed_suffix_to_trashed_posts` filter-hook.
 * 
 * @param bool   $add_trashed_suffix Whether to attempt to add the suffix.
 * @param string $post_name          The name of the post being updated.
 * @param int    $post_id            Post ID.
 *
 * @return bool
 */
function wp_kama_add_trashed_suffix_to_posts_filter( $add_trashed_suffix, $post_name, $post_id ){

	// filter...
	return $add_trashed_suffix;
}
$add_trashed_suffix(true|false)
Whether to attempt to add the suffix.
$post_name(строка)
The name of the post being updated.
$post_id(int)
Post ID.

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

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

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

wp_insert_post()
add_trashed_suffix_to_trashed_posts
wp-includes/post.php 4446
$add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_id );

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

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