summaryrefslogtreecommitdiff
path: root/src/MetaboxField.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-06-06 11:42:35 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-06-06 11:42:35 +0200
commit071cc98047e1640e3a6b78bc62eef67ff29719b1 (patch)
tree764abae43da0a1838d51d5f05213180d5a78107a /src/MetaboxField.php
parentf464f665794cebcb354bbf27f7159608fc3ece3c (diff)
add "width" functionv1.3.0
Diffstat (limited to 'src/MetaboxField.php')
-rw-r--r--src/MetaboxField.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/MetaboxField.php b/src/MetaboxField.php
index 4ace7b1..9602ea7 100644
--- a/src/MetaboxField.php
+++ b/src/MetaboxField.php
@@ -102,6 +102,18 @@ class MetaboxField
}
/**
+ * @param int $width
+ *
+ * @return $this
+ */
+ public function width(int $width) {
+ $this->options['wrapper'] ??= [];
+ $this->options['wrapper']['width'] = $width < 1 ? $width*100 : $width;
+
+ return $this;
+ }
+
+ /**
* Add the acf local field
*/
public function add()