disciple-tools-theme icon indicating copy to clipboard operation
disciple-tools-theme copied to clipboard

Tile visibility structure

Open corsacca opened this issue 1 year ago • 4 comments

Current structure:

$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:

$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:

'conditions' => [
    'overall_status' => [ '-closed'],
]

Might need a settings migration to change structure

corsacca avatar Mar 24 '23 10:03 corsacca