DiscipleTools / DiscipleTools/disciple-tools-theme

Tile visibility structure

Open
#2,004 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
48
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Current structure:
```php
$tiles['disciple_tools_plugin_starter_template'] = [
'label' => __( 'Plugin Starter Template', 'disciple-tools-plugin-starter-template' ),
'description' => __( 'This is a tile that is added by the plugin starter template.', 'disciple-tools-plugin-starter-template' ),
'hidden' => false,
'display_conditions' => [
'visibility' => 'visible', //hidden, custom, visible
'operator' => 'or', //and, or
'conditions' => [
'overall_status__active' => [ 'key' => 'overall_status', 'value' => 'active' ],
'overall_status__paused' => [ 'key' => 'overall_status', 'value' => 'paused' ],
'tags__tag1' => [ 'key' => 'tags', 'value' => 'tag1' ],
'tags__tag'2 => [ 'key' => 'tags', 'value' => 'tag2' ]
],
],
];
```

Desired Structure:
```php
$tiles['disciple_tools_plugin_starter_template'] = [
'label' => __( 'Plugin Starter Template', 'disciple-tools-plugin-starter-template' ),
'description' => __( 'This is a tile that is added by the plugin starter template.', 'disciple-tools-plugin-starter-template' ),
'hidden' => false,
'display_conditions' => [
'visibility' => 'visible', //hidden, custom, visible
'operator' => 'or', //and, or
'conditions' => [
'overall_status' => [ 'active', 'paused' ],
'tags' = [ 'tag1', 'tag2' ],
]
],
];
```

Also add the ability to filter out:
```php
'conditions' => [
'overall_status' => [ '-closed'],
]
```

Might need a settings migration to change structure

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.