Skip to content

Commit 9b0653c

Browse files
committed
Translation option for the field.
1 parent 8eb0ee9 commit 9b0653c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/Field.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ abstract class Field {
100100
*/
101101
protected $default_value;
102102

103+
/**
104+
* Translation option for the field.
105+
*
106+
* @var string
107+
*/
108+
protected $translations;
109+
103110
/**
104111
* Filters and actions to be hooked.
105112
*
@@ -727,6 +734,27 @@ public function get_default_value() {
727734
return $this->default_value;
728735
}
729736

737+
/**
738+
* Set translation option for the field.
739+
*
740+
* @param string $translations Type of translation.
741+
* @return self
742+
*/
743+
public function set_translations( $translations ) {
744+
$this->translations = $translations;
745+
746+
return $this;
747+
}
748+
749+
/**
750+
* Get translation option of the field.
751+
*
752+
* @return mixed
753+
*/
754+
public function get_translations() {
755+
return $this->translations;
756+
}
757+
730758
/**
731759
* Hide the field label in the admin side
732760
*

0 commit comments

Comments
 (0)