WordPress как на ладони
wordpress jino
событие не описано

wp_trash_post хук-событие . WP 3.3.0

Fires before a post is sent to the trash.

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

add_action( 'wp_trash_post', 'action_function_name_6557' );
function action_function_name_6557( $post_id ){
	// action...
}
$post_id(int)
Post ID.

Связи хука

Используется в: wp_trash_post(), WP_Customize_Manager::trash_changeset_post()

Остальные хуки из: wp_trash_post():

Остальные хуки из: WP_Customize_Manager::trash_changeset_post():

Кусок кода с хуком

Фрагмент из: wp-includes/post.php WP 4.9
...
	 * @param bool    $trash Whether to go forward with trashing.
	 * @param WP_Post $post  Post object.
	 */
	$check = apply_filters( 'pre_trash_post', null, $post );
	if ( null !== $check ) {
		return $check;
	}

	/**
	 * Fires before a post is sent to the trash.
	 *
	 * @since 3.3.0
	 *
	 * @param int $post_id Post ID.
	 */
	do_action( 'wp_trash_post', $post_id );

	add_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status );
	add_post_meta( $post_id, '_wp_trash_meta_time', time() );

	wp_update_post( array( 'ID' => $post_id, 'post_status' => 'trash' ) );

	wp_trash_post_comments( $post_id );

	/**
	 * Fires after a post is sent to the trash.
	 *
	 * @since 2.9.0
	 *
	 * @param int $post_id Post ID.
	 */
...
Фрагмент из: wp-includes/class-wp-customize-manager.php WP 4.9
...
		if ( ! EMPTY_TRASH_DAYS ) {
			return wp_delete_post( $post_id, true );
		}

		if ( 'trash' === get_post_status( $post ) ) {
			return false;
		}

		/** This filter is documented in wp-includes/post.php */
		$check = apply_filters( 'pre_trash_post', null, $post );
		if ( null !== $check ) {
			return $check;
		}

		/** This action is documented in wp-includes/post.php */
		do_action( 'wp_trash_post', $post_id );

		add_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status );
		add_post_meta( $post_id, '_wp_trash_meta_time', time() );

		$old_status = $post->post_status;
		$new_status = 'trash';
		$wpdb->update( $wpdb->posts, array( 'post_status' => $new_status ), array( 'ID' => $post->ID ) );
		clean_post_cache( $post->ID );

		$post->post_status = $new_status;
		wp_transition_post_status( $new_status, $old_status, $post );

		/** This action is documented in wp-includes/post.php */
		do_action( 'edit_post', $post->ID, $post );

...