wip: 2026-02-15T09:49:59+0100 (1771145399)

This commit is contained in:
Victor Westerlund 2026-02-15 09:49:59 +01:00
parent 97b48aaf52
commit b1619635b2
Signed by: vlw
GPG key ID: D0AD730E1057DFC6
2 changed files with 12 additions and 0 deletions

View file

@ -10,6 +10,7 @@
use vlw\WP\Tables\Posts;
use vlw\WP\Posts\PostMeta;
use vlw\WP\Posts\Taxonomy\Term;
use vlw\WP\Posts\Type\Attachment;
use function vlw\WP\Support\slugify;
require_once "Taxonomy/Term.php";

View file

@ -86,6 +86,17 @@
);
}
/**
* Delete this post meta field from the database
*
* @return void
*/
public function delete(): void {
$this->db
->from(PostMetaTable::TABLE_NAME)
->delete([PostMetaTable::META_ID->value => $this->id]);
}
public Post $post {
get => new Post($this->get(PostMetaTable::POST_ID->value));
set (Post $post) => $this->set(PostMetaTable::POST_ID->value, $post->id);