*/ private const EDIT_BLOCKED_STATUSES = [ PostStatus::Published, PostStatus::PartiallyPublished, PostStatus::Failed, PostStatus::Publishing, ]; /** * Statuses where the post can no longer be deleted. * * @var array */ private const DELETE_BLOCKED_STATUSES = [ PostStatus::Publishing, PostStatus::Published, PostStatus::PartiallyPublished, ]; public static function blocksEditing(Post $post): bool { return in_array($post->status, self::EDIT_BLOCKED_STATUSES, true); } public static function blocksDeletion(Post $post): bool { return in_array($post->status, self::DELETE_BLOCKED_STATUSES, true); } public static function editBlockedMessage(): string { return __(self::EDIT_BLOCKED_MESSAGE_KEY); } }