Learn more about CSS Classes
* @a-order 1
*/
public string $cssClasses;
/**
* @a-type post_object
* @post_type ["acf_views"]
* @return_format id
* @label ACF View
* @required 1
* @instructions Assigned ACF View is used to display every post from the query results
* @a-order 1
*/
public int $acfViewId;
/**
* @a-type tab
* @a-order 2
*/
public bool $filters;
/**
* @a-type select
* @required 1
* @multiple 1
* @ui 1
* @label Post Type
* @instructions Filter by post type. You can select multiple items
* @a-order 2
*/
public array $postTypes;
/**
* @a-type select
* @required 1
* @multiple 1
* @ui 1
* @label Post Status
* @instructions Filter by post status. You can select multiple items
* @a-order 2
* @default_value ["publish"]
*/
public array $postStatuses;
/**
* @required 1
* @label Maximum amount of posts
* @instructions Use '-1' to set 'unlimited'
* @a-order 2
* @default_value -1
*/
public int $limit;
/**
* @a-type post_object
* @return_format id
* @label Pool of posts
* @multiple 1
* @instructions Here you can manually assign specific posts. If set then the query will be limited to posts ONLY from this pool. It means the result will consist ONLY from posts from this pool, which also fit all other filters. If you want to have the same order of results like here, please choose the 'Pool of posts' option in the Sort tab
* @a-order 2
*/
public array $postIn;
/**
* @a-type post_object
* @return_format id
* @label Exclude posts
* @instructions Here you can manually exclude specific posts from the query. It means the query will ignore posts from this list, even they're fit filters. Warning : this field can't be used together with 'Pool of posts'
* @multiple 1
* @a-order 2
*/
public array $postNotIn;
/**
* @label Ignore Sticky Posts
* @instructions If unchecked then sticky posts will be at the top of results. Read more about sticky posts
* @a-order 2
*/
public bool $isIgnoreStickyPosts;
/**
* @a-type tab
* @label Sort
* @a-order 5
*/
public bool $orderTab;
/**
* @a-type select
* @ui 1
* @required 1
* @label Order by
* @instructions Select which field results should be filtered by. ‘Default’ keeps the default order (latest first, sticky options may affect it)
* @choices {"none":"Default","ID": "ID","menu_order":"Menu order","meta_value":"Meta value","meta_value_num":"Meta value numeric","author": "Author","title": "Title","name": "Name","type": "Type","date": "Date","modified": "Modified","parent": "Parent","rand": "Rand","comment_count": "Comment count","post__in":"Pool of posts"}
* @default_value none
* @a-order 5
*/
public string $orderBy;
/**
* @a-type select
* @ui 1
* @required 1
* @label Order
* @instructions Defines the sorting order of posts
* @choices {"ASC":"Ascending","DESC": "Descending"}
* @default_value ASC
* @a-order 5
*/
public string $order;
/**
* @a-type select
* @return_format value
* @required 1
* @ui 1
* @label Order By Meta Field Group
* @instructions Select a target group
* @conditional_logic [[{"field": "local_acf_views_acf-card-data__order-by","operator": "==","value": "meta_value"}],[{"field": "local_acf_views_acf-card-data__order-by","operator": "==","value": "meta_value_num"}]]
* @a-order 5
*/
public string $orderByMetaFieldGroup;
/**
* @a-type select
* @return_format value
* @label Order By Meta Field
* @required 1
* @instructions Select a target field. Note : only fields with supported field types are listed here
* @conditional_logic [[{"field": "local_acf_views_acf-card-data__order-by","operator": "==","value": "meta_value"}],[{"field": "local_acf_views_acf-card-data__order-by","operator": "==","value": "meta_value_num"}]]
* @a-order 5
*/
public string $orderByMetaFieldKey;
/**
* @a-type tab
* @label Advanced
* @a-order 7
*/
public bool $advanced;
/**
* @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 card. You should use '.acf-card--id--X' selector to match the current card (where 'X' means the current card id) OR you can use magic '#card' alias, that will be automatically replaced with target '.acf-card--id--X' (it means you can have '#card .acf-card__items' as a selector, and it'll work right). To match items wrapper you should use '#card .acf-card__items' selector, to match single item you should use '#card .acf-view' selector
* @a-order 7
*/
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 7
*/
public string $jsCode;
/**
* @a-type textarea
* @label Query Preview
* @instructions For debug purposes. Here you can see the query that will be executed to get posts for this card. Important! Publish or Update your card to see the latest query
* @a-order 7
*/
public string $queryPreview;
public static function getGroupInfo(): array
{
return array_merge(parent::getGroupInfo(), [
'title' => 'Card settings',
]);
}
public function getOrderByMetaAcfFieldId(): string
{
return Field::getAcfFieldIdByKey($this->orderByMetaFieldKey);
}
}