public static function get_value_from_setting($value, $setting_name) { $settings = dxw_get_setting($setting_name); if (array_key_exists($value, $settings)) { return $value; } else { return new \WP_Error('content-review', 'Invalid setting chosen'); } }
</p> <p> <label for="dxw-review-email">Set reviewer email address(es)</label> <input type="text" name="dxw_review_email" id="dxw-review-email" value="<?php echo esc_attr($args['dxw_review_email']); ?> " style="width:100%"> <span class="description">Comma (,) separate multiple emails</span> </p> <p> <label for="dxw_review_action">Action on review date</label> <select name="dxw_review_action" id="dxw-review-action" style="width:100%"> <?php foreach (dxw_get_setting('dxw_review_action') as $value => $label) { ?> <option value="<?php echo $value; ?> " <?php selected($args['dxw_review_action'], $value); ?> ><?php echo $label; ?> </option> <?php } ?> </select>
/** * dxw_get_path. * * Returns the path to a file within the plugin directory * * @param [string] $path The relative path from the root of the plugin folder * * @return [string] */ function dxw_get_path($path) { return dxw_get_setting('path') . $path; }