时间:2024-03-12
WordPress函数wp_delete_attachment用于删除指定ID的附件。
wp_delete_attachment( int $post_id, bool $force_delete = false )
$post_id
整数
附件ID
$force_delete
布尔值,默认值:false
是否跳过回收站永久性删除,如果设置为true,将立即删除附件对应的文件。
wp_delete_attachment()函数位于:wp-includes/post.php
相关函数:
clean_dirsize_cache()
pre_delete_attachment()
wp_delete_attachment_files()
wp_delete_object_term_relationships()
Copyright © 2019-2024 php.pink