# supportcandy/2.3.1/includes/admin/custom_fields/get_conditional_options.php

SupportCandy – AI Customer Support Ticket System &amp; Live Chatbot Agent, version 2.3.1. 20 lines.

- Page: https://pluginprobe.com/plugins/supportcandy/2.3.1/code/includes/admin/custom_fields/get_conditional_options.php
- Raw: https://pluginprobe.com/plugins/supportcandy/2.3.1/raw/includes/admin/custom_fields/get_conditional_options.php
- Modified: 2022-07-21T08:20:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/supportcandy/2.3.1/code/includes/admin/custom_fields/get_conditional_options.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

global $current_user, $wpscfunction;

if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}

$key = isset($_POST) && isset($_POST['key']) ? sanitize_text_field($_POST['key']) : 0;
if (!$key) {exit;}

$options = $wpscfunction->get_condition_options($key);

foreach ( $options as $option ) :
  ?>
  <option value="<?php echo esc_attr($option['value'])?>"><?php echo esc_attr($option['label'])?></option>
  <?php 
endforeach;

```
