Adding and removing of pictures via API is now possible

This commit is contained in:
Michael 2023-02-28 06:19:19 +00:00
parent a56d2f2eb8
commit 98aed4dde3
3 changed files with 101 additions and 37 deletions

View file

@ -721,7 +721,7 @@ class Media
*
* @param int $uri_id URI id
* @param array $types Media types
* @return bool Whether media attachment exists
* @return bool result of deletion
* @throws \Exception
*/
public static function deleteByURIId(int $uri_id, array $types = []): bool
@ -735,6 +735,18 @@ class Media
return DBA::delete('post-media', $condition);
}
/**
* Delete media by id
*
* @param int $id media id
* @return bool result of deletion
* @throws \Exception
*/
public static function deleteById(int $id): bool
{
return DBA::delete('post-media', ['id' => $id]);
}
/**
* Split the attachment media in the three segments "visual", "link" and "additional"
*