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; /** * @label Link Label * @instructions You can set the link label here. Left empty to use the default * @a-order 2 */ public string $linkLabel; /** * @label Image Size * @instructions Controls the size of the image, it changes the image src * @a-type select * @required 1 * @default_value full * @a-order 2 */ public string $imageSize; /** * @a-type tab * @label Advanced * @a-order 4 */ public bool $advancedTab; /** * @label Identifier * @instructions Used in the markup, 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); } }