wp_import_cleanup()
云策文档标注
概述
wp_import_cleanup() 是一个 WordPress 函数,用于清理导入器,通过删除指定 ID 的附件来实现。
关键要点
- 函数功能:基于附件 ID 移除附件,调用 wp_delete_attachment() 执行删除操作。
- 参数:$id(字符串,必需),表示要删除的附件 ID。
- 相关函数:与 wp_delete_attachment() 关联,后者负责附件的实际删除或移至回收站。
- 版本历史:自 WordPress 2.0.0 版本引入。
原文内容
Cleanup importer.
Description
Removes attachment based on ID.
Parameters
$idstringrequired-
Importer ID.
Source
function wp_import_cleanup( $id ) {
wp_delete_attachment( $id );
}
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |