如何在Wordpress中的垃圾操作后添加wp\U垃圾\U post操作?

如何在Wordpress中的垃圾操作后添加wp\U垃圾\U post操作?,wordpress,Wordpress,我需要在帖子被移动到垃圾堆后添加一个操作。当我添加一个操作时,它会在主垃圾箱操作之前运行。但我想在第一次手术后添加它 public function register_process() { add_action( 'wp_trash_post', [ $this, 'update_cache_custom_post_type' ], 10 ); } public function update_cache_custom_post_type() { gl

我需要在帖子被移动到垃圾堆后添加一个操作。当我添加一个操作时,它会在主垃圾箱操作之前运行。但我想在第一次手术后添加它

public function register_process() {
        add_action( 'wp_trash_post', [ $this, 'update_cache_custom_post_type' ], 10 );
    }

public function update_cache_custom_post_type() {
        global $post;
        if ( 'custom_post_tpe' == $post->post_type ) {
            // update cache
        }
    }

您可以使用“垃圾”post挂钩,该挂钩在将邮件发送到垃圾箱后启动