function themezee_register_settings()
{
    // Choose Setting Tab
    if (isset($_GET['tab'])) {
        $tab = esc_attr($_GET['tab']);
    } else {
        $tab = 'general';
    }
    $themezee_sections = themezee_get_sections($tab);
    $themezee_settings = themezee_get_settings($tab);
    register_setting('themezee_options', 'themezee_options', 'themezee_options_validate');
    // Create Setting Sections
    foreach ($themezee_sections as $section) {
        add_settings_section($section['id'], $section['name'], 'themezee_section_text', 'themezee');
    }
    // Create Setting Fields
    foreach ($themezee_settings as $setting) {
        add_settings_field($setting['id'], $setting['name'], 'themezee_display_setting', 'themezee', $setting['section'], $setting);
    }
}
Exemplo n.º 2
0
function themezee_register_settings()
{
    $themezee_settings = themezee_get_settings();
    $themezee_sections = themezee_get_sections();
    register_setting('themezee_options', 'themezee_options', 'themezee_options_validate');
    // Create Setting Sections
    foreach ($themezee_sections as $section) {
        add_settings_section($section['id'], $section['name'], 'themezee_section_text', 'themezee');
    }
    // Create Setting Fields
    foreach ($themezee_settings as $setting) {
        add_settings_field($setting['id'], $setting['name'], 'themezee_display_setting', 'themezee', $setting['section'], $setting);
    }
}