mirror of
https://codeberg.org/vlw/wp.git
synced 2026-02-26 12:01:57 +01:00
fix: Post property hook object return types
This commit is contained in:
parent
1b0a9f385f
commit
d725a63293
1 changed files with 5 additions and 5 deletions
|
|
@ -98,12 +98,12 @@
|
||||||
|
|
||||||
public DateTimeImmutable $post_date {
|
public DateTimeImmutable $post_date {
|
||||||
get => new DateTimeImmutable($this->get(Posts::POST_DATE->value));
|
get => new DateTimeImmutable($this->get(Posts::POST_DATE->value));
|
||||||
set (DateTimeImmutable $post_date) => $this->set(Posts::POST_DATE->value, $post_date->format(static::DATETIME_FORMAT));
|
set (DateTimeImmutable $post_date) => $this->set(Posts::POST_DATE->value, $post_date->format(static::DATETIME_FORMAT), $post_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTimeImmutable $post_date_gmt {
|
public DateTimeImmutable $post_date_gmt {
|
||||||
get => new DateTimeImmutable($this->get(Posts::POST_DATE_GMT->value));
|
get => new DateTimeImmutable($this->get(Posts::POST_DATE_GMT->value));
|
||||||
set (DateTimeImmutable $post_date_gmt) => $this->set(Posts::POST_DATE_GMT->value, $post_date_gmt->format(static::DATETIME_FORMAT));
|
set (DateTimeImmutable $post_date_gmt) => $this->set(Posts::POST_DATE_GMT->value, $post_date_gmt->format(static::DATETIME_FORMAT), $post_date_gmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string $post_content {
|
public string $post_content {
|
||||||
|
|
@ -158,17 +158,17 @@
|
||||||
|
|
||||||
public DateTimeImmutable $post_modified {
|
public DateTimeImmutable $post_modified {
|
||||||
get => new DateTimeImmutable($this->get(Posts::POST_MODIFIED->value));
|
get => new DateTimeImmutable($this->get(Posts::POST_MODIFIED->value));
|
||||||
set (DateTimeImmutable $post_modified) => $this->set(Posts::POST_MODIFIED->value, $post_modified->format(static::DATETIME_FORMAT));
|
set (DateTimeImmutable $post_modified) => $this->set(Posts::POST_MODIFIED->value, $post_modified->format(static::DATETIME_FORMAT), $post_modified);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTimeImmutable $post_modified_gmt {
|
public DateTimeImmutable $post_modified_gmt {
|
||||||
get => new DateTimeImmutable($this->get(Posts::POST_MODIFIED_GMT->value));
|
get => new DateTimeImmutable($this->get(Posts::POST_MODIFIED_GMT->value));
|
||||||
set (DateTimeImmutable $post_modified_gmt) => $this->set(Posts::POST_MODIFIED_GMT->value, $post_modified_gmt->format(static::DATETIME_FORMAT));
|
set (DateTimeImmutable $post_modified_gmt) => $this->set(Posts::POST_MODIFIED_GMT->value, $post_modified_gmt->format(static::DATETIME_FORMAT), $post_modified_gmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Post|false|null $post_parent {
|
public Post|false|null $post_parent {
|
||||||
get => $this->get(Posts::POST_PARENT->value) !== 0 ? new self($this->get(Posts::POST_PARENT->value)) : null;
|
get => $this->get(Posts::POST_PARENT->value) !== 0 ? new self($this->get(Posts::POST_PARENT->value)) : null;
|
||||||
set (Post|false|null $post_parent) => $this->set(Posts::POST_PARENT->value, $post_parent ? $post_parent->id : 0);
|
set (Post|false|null $post_parent) => $this->set(Posts::POST_PARENT->value, $post_parent ? $post_parent->id : 0, $post_parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string $guid {
|
public string $guid {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue