WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
4326 | /** |
4327 | * Filters whether or not to add a `__trashed` suffix to trashed posts that match the name of the updated post. |
4328 | * |
4329 | * @since 5.4.0 |
4330 | * |
4331 | * @param bool $add_trashed_suffix Whether to attempt to add the suffix. |
4332 | * @param string $post_name The name of the post being updated. |
4333 | * @param int $post_ID Post ID. |
4334 | */ |
4335 | $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_ID ); |
4336 |
|
4337 | if ( $add_trashed_suffix ) { |
4338 | wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID ); |
4339 | } |
4340 | } |
4341 |
|
4342 | // When trashing an existing post, change its slug to allow non-trashed posts to use it. |
4343 | if ( 'trash' === $post_status && 'trash' !== $previous_status && 'new' !== $previous_status ) { |
4344 | $post_name = wp_add_trashed_suffix_to_post_name_for_post( $post_ID ); |