Learn more about CSS Classes */ public string $cssClasses; /** * @item \org\wplake\acf_views\AcfGroups\Item * @var Item[] * @label Fields * @button_label Add Field * @a-no-accordion 1 * @a-order 2 */ public array $items; /** * @a-type tab * @label Advanced * @a-order 3 */ public bool $advanced; /** * @a-type textarea * @new_lines br * @label Markup * @instructions Output preview of HTML markup generated. Important! Publish or Update your view to see the latest markup * @a-order 3 */ public string $markup; /** * @a-type textarea * @label CSS Code * @instructions Define your CSS style rules. This will be added within <style></style> tags ONLY to pages that have this view. You should use '.acf-view--id--X' selector to match the current view (where 'X' means the current view id) OR you can use magic '#view' alias, that will be automatically replaced with target '.acf-view--id--X' (it means you can have '#view .acf-view__field' as a selector, and it'll work right) * @a-order 3 */ public string $cssCode; /** * @a-type textarea * @label JS Code * @instructions Add your own Javascript to your view. This will be added within <script></script> tags ONLY to pages that have this view and also will be wrapped into an anonymous function to avoid name conflicts * @a-order 3 */ public string $jsCode; private array $fieldsMeta; public function __construct(CreatorInterface $creator) { parent::__construct($creator); $this->fieldsMeta = []; } public static function getGroupInfo(): array { return array_merge(parent::getGroupInfo(), [ 'title' => 'View settings', ]); } public function setFieldsMeta(array $fieldsMeta = [], bool $isForce = false): void { if ($fieldsMeta || $isForce) { $this->fieldsMeta = $fieldsMeta; return; } foreach ($this->items as $item) { $fieldId = $item->field->getAcfFieldId(); $this->fieldsMeta[$fieldId] = new FieldMeta($fieldId); } } public function getFieldsMeta(): array { return $this->fieldsMeta; } }