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



{$old_status}_to_{$new_status} › WordPress动作钩子

Since2.3.0
已弃用n/a
› do_action( "{$old_status}_to_{$new_status}", $post )
参数:
  • () post Post object.
    Required: Yes
定义在:
文档:

Fires when a post is transitioned from one status to another.

The dynamic portions of the hook name, `$new_status` and `$old_status`, refer to the old and new post statuses, respectively. Possible hook names include: - `draft_to_publish` - `publish_to_trash` - `pending_to_draft`




源码

do_action( "{$old_status}_to_{$new_status}", $post );