supported field types are listed here * @a-order 2 */ public string $key; /** * @label Label * @instructions If filled will be added to the markup as a prefix label of the field above * @a-order 2 */ public string $label; /** * @a-type tab * @label Advanced * @a-order 4 */ public bool $advancedTab; /** * @label Identifier * @instructions Will be added to the field markup as a class, leave empty to use chosen field name. Allowed symbols : letters, numbers, underline and dash. Important! Should be unique within the group * @a-order 6 */ public string $id; /** * @label Default Value * @instructions Set up default value, only used when the field is empty * @a-order 6 */ public string $defaultValue; /** * @label Show When Empty * @instructions By default, empty fields are hidden. Turn on to show even when field has no value. * @a-order 6 */ public bool $isVisibleWhenEmpty; public static function getAcfFieldIdByKey(string $key): string { $fieldId = explode('|', $key); // group, field, [subField] return 3 === count($fieldId) ? $fieldId[2] : ($fieldId[1] ?? ''); } public static function createKey(string $group, string $field, string $subField = ''): string { $fullFieldId = $group . '|' . $field; $fullFieldId .= $subField ? '|' . $subField : ''; return $fullFieldId; } public function getAcfFieldId(): string { return self::getAcfFieldIdByKey($this->key); } }