From f8ffc3dc1748b9af63123eb281696c0c30448715 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 30 Aug 2026 03:43:48 +0000
Subject: [PATCH] =Meta overhaul, attempting to simplify. Maybe it did?
---
inc/meta/Repeater.php | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/inc/meta/Repeater.php b/inc/meta/Repeater.php
index 583ae44..a387296 100644
--- a/inc/meta/Repeater.php
+++ b/inc/meta/Repeater.php
@@ -25,7 +25,7 @@
$this->meta = $meta;
$this->name = $name;
$this->data = $meta->get($name) ?: [];
- $this->config = $meta->config($name) ?? [];
+ $this->config = $meta->getFieldConfig($name) ?? [];
// Ensure data is array
if (!is_array($this->data)) {
@@ -111,16 +111,14 @@
/**
* Set field value in specific row
*/
- public function setField(int $index, string $field, mixed $value): self
+ public function setField(int $index, string $field, mixed $value):bool
{
if (!isset($this->data[$index])) {
$this->data[$index] = [];
}
$this->data[$index][$field] = $value;
- $this->sync();
-
- return $this;
+ return $this->sync();
}
/**
@@ -374,9 +372,9 @@
/**
* Sync data back to Meta instance
*/
- protected function sync(): void
+ protected function sync(): bool
{
- $this->meta->set($this->name, $this->data);
+ return $this->meta->set($this->name, $this->data);
}
/**
@@ -392,6 +390,6 @@
*/
public function rowLabelField(): ?string
{
- return $this->config['row_label'] ?? null;
+ return $this->config['add_label'] ?? null;
}
}
--
Gitblit v1.10.0