public function epl_labels()
 {
     $field_groups = epl_get_admin_option_fields();
     foreach ($field_groups as $field_group) {
         if ($field_group['id'] == 'labels') {
             $epl_labels = array_filter($field_group['fields']);
             break;
         }
     }
     foreach ($epl_labels as $label_key => $label) {
         if ($label_key = $label['name']) {
             $default = isset($label['default']) ? $label['default'] : '';
             if (isset($this->epl_settings[$label_key]) && $this->epl_settings[$label_key] != '') {
                 $this->{$label_key} = $this->epl_settings[$label_key];
             } else {
                 $this->{$label_key} = $default;
             }
         }
     }
 }
示例#2
0
function epl_labels($key)
{
    global $epl_settings;
    $field_groups = epl_get_admin_option_fields();
    $epl_labels = array();
    foreach ($field_groups as $field_group) {
        if ($field_group['id'] == 'labels' || $field_group['id'] == 'address') {
            $epl_labels = array_merge($epl_labels, array_filter($field_group['fields']));
        }
    }
    foreach ($epl_labels as $label_key => $label) {
        if (isset($label['default']) && $key == $label['name']) {
            $label = isset($epl_settings[$key]) ? $epl_settings[$key] : $label['default'];
            return apply_filters('epl_display_' . $key, $label);
        }
    }
}
示例#3
0
<?php

/**
 * General Menu Page options
 *
 * @since 1.0
 * @return void
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
$fields = epl_get_admin_option_fields();
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'epl_settings') {
    if (!empty($fields)) {
        foreach ($fields as &$field_group) {
            $field_group['fields'] = array_filter($field_group['fields']);
            foreach ($field_group['fields'] as $field) {
                if ($field['type'] == 'help') {
                    continue;
                }
                if ($field['type'] == 'radio' || $field['type'] == 'checkbox') {
                    if (!isset($_REQUEST[$field['name']])) {
                        $_REQUEST[$field['name']] = '';
                    }
                }
                if ($field['type'] == 'text') {
                    if (isset($_REQUEST[$field['name']])) {
                        $_REQUEST[$field['name']] = sanitize_text_field($_REQUEST[$field['name']]);
                    }
                }