Exemplo n.º 1
0
 function get_settings_tabs($panel = 'site')
 {
     $settings_object = new EditorSettings();
     $tabs = array();
     $tabs['heading'] = __('Global Settings', 'pagelines');
     foreach ($settings_object->get_set('site') as $tabkey => $tab) {
         $tabs[$tabkey] = array('key' => $tabkey, 'name' => $tab['name'], 'icon' => isset($tab['icon']) ? $tab['icon'] : '');
     }
     return $tabs;
 }
Exemplo n.º 2
0
function get_default_settings()
{
    $settings_object = new EditorSettings();
    $settings = $settings_object->get_set();
    $defaults = array();
    foreach ($settings as $tab => $tab_settings) {
        foreach ($tab_settings['opts'] as $index => $opt) {
            if ($opt['type'] == 'multi') {
                foreach ($opt['opts'] as $subi => $sub_opt) {
                    if (isset($sub_opt['default'])) {
                        $defaults[$sub_opt['key']] = $sub_opt['default'];
                    }
                }
            }
            if (isset($opt['default'])) {
                $defaults[$opt['key']] = $opt['default'];
            }
        }
    }
    return $defaults;
}