From 071cc98047e1640e3a6b78bc62eef67ff29719b1 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 6 Jun 2024 11:42:35 +0200 Subject: add "width" function --- src/MetaboxField.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/MetaboxField.php b/src/MetaboxField.php index 4ace7b1..9602ea7 100644 --- a/src/MetaboxField.php +++ b/src/MetaboxField.php @@ -101,6 +101,18 @@ class MetaboxField return $this; } + /** + * @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 */ -- cgit v1.2.3