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 |
---|---|
3905 | /** |
3906 | * Filters whether or not to add a `__trashed` suffix to trashed posts that match the name of the updated post. |
3907 | * |
3908 | * @since 5.4.0 |
3909 | * |
3910 | * @param bool $add_trashed_suffix Whether to attempt to add the suffix. |
3911 | * @param string $post_name The name of the post being updated. |
3912 | * @param int $post_ID Post ID. |
3913 | */ |
3914 | $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_ID ); |
3915 |
|
3916 | if ( $add_trashed_suffix ) { |
3917 | wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID ); |
3918 | } |
3919 | } |
3920 |
|
3921 | // When trashing an existing post, change its slug to allow non-trashed posts to use it. |
3922 | if ( 'trash' === $post_status && 'trash' !== $previous_status && 'new' !== $previous_status ) { |
3923 | $post_name = wp_add_trashed_suffix_to_post_name_for_post( $post_ID ); |