Learn more about CSS Classes */ public string $cssClasses; /** * @label With Gutenberg Block * @instructions If checked, a separate gutenberg block for this view will be available * @a-order 2 * @a-pro The field must be not required or have default value! */ public bool $isHasGutenbergBlock; /** * @item \org\wplake\acf_views\AcfGroups\Item * @var Item[] * @label Fields * @instructions Fields of this view. Tip : hover mouse to the field number column and drag to reorder * @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; /** * @a-type textarea * @label Custom Markup * @instructions Warning : for users familiar with HTML. Write your own HTML markup with full control over how your view will look. You can copy the Markup field output and make your changes. Make sure you've kept all variables (look like '$name$') and wrappers (look like HTML comments), otherwise field values won't be inserted. Important! This field will not be updated automatically when you add or remove fields, so you have to update this field manually to reflect the new changes (you could see the Markup field for assistance) * @a-order 4 * @a-pro The field must be not required or have default value! */ public string $customMarkup; 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; } }