My function lets users delete their uploaded images in the front-end. However, they're only deleted in the Media Library. That means that they're still in wp-content/uploads/.
public static function removePhoto($ID, $attachment) {
if(isset(self::$data['user']['photos'][$attachment])) {
unset(self::$data['user']['photos'][$attachment]);
wp_delete_attachment($attachment);
core:updateUserMeta($ID, 'photos', self::$data['user']['photos']);
}
}
Any ideas?
Aucun commentaire:
Enregistrer un commentaire