<?php

require_once('api.php');
require_once('style.php');

add_action('admin_init', 'theme_options_init');
add_action('admin_menu', 'theme_options_add_page');

/* ------------------ */
/* theme options page */
/* ------------------ */

add_action('admin_init', 'theme_options_init');
add_action('admin_menu', 'theme_options_add_page');

// Einstellungen registrieren (http://codex.wordpress.org/Function_Reference/register_setting)
function theme_options_init()
{
    register_setting('wowpress_options', 'wowpress_api', 'kb_validate_options');
    register_setting('wowpress_options', 'wowpress_style', 'kb_validate_options');

}

// Seite in der Dashboard-Navigation erstellen
function theme_options_add_page()
{

    add_menu_page(
        'API-Keys',
        'API-Keys',
        'wowpress_edit_site',
        'wowpress_api_options',
        'wowpress_api_options_page',
        'dashicons-lock',
        25
    );

    add_menu_page(
        'Hintergrund',
        'Hintergrund',
        'wowpress_edit_site',
        'wowpress_style_options',
        'wowpress_style_options_page',
        'dashicons-format-image',
        26
    );
}


// Strip HTML-Code:
// Hier kann definiert werden, ob HTML-Code in einem Eingabefeld 
// automatisch entfernt werden soll. Soll beispielsweise im 
// Copyright-Feld KEIN HTML-Code erlaubt werden, kommentiert die Zeile 
// unten wieder ein. http://codex.wordpress.org/Function_Reference/wp_filter_nohtml_kses
function kb_validate_options($input)
{
    // $input['copyright'] = wp_filter_nohtml_kses( $input['copyright'] );
    return $input;
}
