mirror of
https://codeberg.org/vlw/wp.git
synced 2026-02-26 03:51:58 +01:00
wip: 2026-02-15T09:49:59+0100 (1771145399)
This commit is contained in:
parent
97b48aaf52
commit
b1619635b2
2 changed files with 12 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
||||||
use vlw\WP\Tables\Posts;
|
use vlw\WP\Tables\Posts;
|
||||||
use vlw\WP\Posts\PostMeta;
|
use vlw\WP\Posts\PostMeta;
|
||||||
use vlw\WP\Posts\Taxonomy\Term;
|
use vlw\WP\Posts\Taxonomy\Term;
|
||||||
|
use vlw\WP\Posts\Type\Attachment;
|
||||||
use function vlw\WP\Support\slugify;
|
use function vlw\WP\Support\slugify;
|
||||||
|
|
||||||
require_once "Taxonomy/Term.php";
|
require_once "Taxonomy/Term.php";
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
public Post $post {
|
||||||
get => new Post($this->get(PostMetaTable::POST_ID->value));
|
get => new Post($this->get(PostMetaTable::POST_ID->value));
|
||||||
set (Post $post) => $this->set(PostMetaTable::POST_ID->value, $post->id);
|
set (Post $post) => $this->set(PostMetaTable::POST_ID->value, $post->id);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue