wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_untrash_post_status › WordPress过滤钩子

Since5.6.0
已弃用n/a
› apply_filters( 'wp_untrash_post_status', $new_status, $post_id, $previous_status )
参数: (3)
  • () new_status The new status of the post being restored.
    Required: Yes
  • () post_id The ID of the post being restored.
    Required: Yes
  • () previous_status The status of the post at the point where it was trashed.
    Required: Yes
定义在:
文档:

Filters the status that a post gets assigned when it is restored from the trash (untrashed).

By default posts that are restored will be assigned a status of 'draft'. Return the value of `$previous_status` in order to assign the status that the post had before it was trashed. The `wp_untrash_post_set_previous_status()` function is available for this. Prior to WordPress 5.6.0, restored posts were always assigned their original status.




源码

$post_status = apply_filters( 'wp_untrash_post_status', $new_status, $post_id, $previous_status );