"sectionOpen", "name" => "Block Headline", "desc" => "Block Description" ), // option array( "type" => "text", "id" => $themeNameShort . "_yourdatabasekey", "name" => "Option Label", "desc" => "Description", "defaultValue" => "" ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_yourdatabasekey", "name" => "Option Label", "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), // option array( "type" => "radio", "id" => $themeNameShort . "_yourdatabasekey", "name" => "Option Label", "desc" => "", "defaultValue" => "bla" ), // option array( "type" => "textarea", "id" => $themeNameShort . "_yourdatabasekey", "name" => "Option Label", "desc" => "Description", "defaultValue" => "" ), array( "type" => "sectionClose" ),*/ /*~~~ section block - END ~~~*/ /*~~~ section block - BEGIN ~~~*/ array( "type" => "sectionOpen", "name" => __( 'Global Settings', 'steffenhollstein_loc' ), "desc" => __( 'Here you can set Page Cross-options.', 'steffenhollstein_loc' ) ), array( "type" => "groupOpen", "headline" => __( 'Color Scheme', 'steffenhollstein_loc' ), ), // option array( "type" => "radio", "id" => $themeNameShort . "_colorscheme", "name" => __( 'Black', 'steffenhollstein_loc' ), "desc" => "", "value" => "black", "defaultValue" => "black" ), // option array( "type" => "radio", "id" => $themeNameShort . "_colorscheme", "name" => __( 'Brown', 'steffenhollstein_loc' ), "desc" => "", "value" => "brown", "defaultValue" => "" ), array( "type" => "groupClose" ), array( "type" => "groupOpen", "headline" => "Google Analytics", ), // option array( "type" => "textarea", "id" => $themeNameShort . "_googleanalytics_trackingcode", "name" => "Google Analytics Tracking Code", "desc" => "", "defaultValue" => "" ), // option array( "type" => "text", "id" => $themeNameShort . "_googlemeta_verifyid", "name" => "Google Metatag Verify-ID", "desc" => "", "defaultValue" => "" ), array( "type" => "groupClose" ), array( "type" => "sectionClose" ), /*~~~ section block - END ~~~*/ /*~~~ section block - BEGIN ~~~*/ array( "type" => "sectionOpen", "name" => __( 'Header: Logo, Menue', 'steffenhollstein_loc' ), "desc" => __( 'Here you can choose links in the header of the page.', 'steffenhollstein_loc' ) ), array( "type" => "groupOpen", "headline" => __( 'Logo', 'steffenhollstein_loc' ), ), // option array( "type" => "text", "id" => $themeNameShort . "_header_custom_logo", "name" => "", "desc" => __( 'Upload your own logo image. Using the WordPress Media Library and then insert the URL here. Note: the maximum image height is 90px / 130px (without Slogan - Options/General -)', 'steffenhollstein_loc' ), "defaultValue" => "" ), array( "type" => "groupClose" ), array( "type" => "groupOpen", "headline" => __( 'Menue', 'steffenhollstein_loc' ), ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_header_show_pages", "name" => __( 'Pages', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_header_show_categorys", "name" => __( 'Categories', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_header_show_archives", "name" => __( 'Archives', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_header_show_bookmarks", "name" => __( 'Links', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_header_show_meta", "name" => __( 'Meta (Admin menu)', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_header_show_search", "name" => __( 'Searchform', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "" // true == show, "" == hide ), array( "type" => "groupClose" ), array( "type" => "sectionClose" ), /*~~~ section block - END ~~~*/ /*~~~ section block - BEGIN ~~~*/ array( "type" => "sectionOpen", "name" => __( 'Footer: Links, Copyright', 'steffenhollstein_loc' ), "desc" => __( 'Here you can choose links in the footer of the page.', 'steffenhollstein_loc' ), ), array( "type" => "groupOpen", "headline" => __( 'Links', 'steffenhollstein_loc' ), ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_showlinks_pages", "name" => __( 'Pages', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_showlinks_categorys", "name" => __( 'Categories', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_showlinks_archives", "name" => __( 'Archives', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_showlinks_bookmarks", "name" => __( 'Links', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_showlinks_meta", "name" => __( 'Meta (Admin menu)', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), array( "type" => "groupClose" ), array( "type" => "groupOpen", "headline" => __( 'Copyright', 'steffenhollstein_loc' ), ), // option array( "type" => "textarea", "id" => $themeNameShort . "_footer_copyright", "name" => __( 'Add your own copyright notice here.', 'steffenhollstein_loc' ), "desc" => __( 'Example (HTML is allowed): Copyright 2012 Your Name. All Rights Reserved.', 'steffenhollstein_loc' ), "defaultValue" => "" ), array( "type" => "groupClose" ), array( "type" => "groupOpen", "headline" => __( 'Icon bar for WordPress, RSS Feed', 'steffenhollstein_loc' ), ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_socialicons_wordpress", "name" => __( 'Display the WordPress logo. Linked to http://wordpress.org/.', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_socialicons_rssfeed", "name" => __( 'Display RSS Feed', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "true" // true == show, "" == hide ), array( "type" => "groupClose" ), array( "type" => "groupOpen", "headline" => __( 'Icon bar for Email', 'steffenhollstein_loc' ), ), // option array( "type" => "text", "id" => $themeNameShort . "_footer_socialicons_email", "name" => __( 'Email', 'steffenhollstein_loc' ), "desc" => __( "You can use the WordPress admin email: ", 'steffenhollstein_loc' ) . '' . get_bloginfo('admin_email') . ".", "defaultValue" => "" ), // option array( "type" => "checkbox", "id" => $themeNameShort . "_footer_socialicons_email_isbase64encoded", "name" => __( 'Is the email encoded by base64? If this option is enabled, the email will be decoded on the page. Useful to hide the mail from spammers.', 'steffenhollstein_loc' ), "desc" => "", "defaultValue" => "" // true == show, "" == hide ), // option array( "type" => "textarea", "id" => $themeNameShort . "_footer_socialicons_email_text", "name" => __( 'Email Text', 'steffenhollstein_loc' ), "desc" => __( "E.g. Write to", 'steffenhollstein_loc' ), "defaultValue" => "" ), array( "type" => "groupClose" ), array( "type" => "groupOpen", "headline" => __( 'Icon bar for Social Networks', 'steffenhollstein_loc' ), ), // option array( "type" => "text", "id" => $themeNameShort . "_footer_socialicons_facebook", "name" => __( 'Facebook', 'steffenhollstein_loc' ), "desc" => __( 'E.g. http://www.facebook.com/YourAccount', 'steffenhollstein_loc' ), "defaultValue" => "" ), // option array( "type" => "text", "id" => $themeNameShort . "_footer_socialicons_googleplus", "name" => __( 'GooglePlus', 'steffenhollstein_loc' ), "desc" => __( 'E.g. https://plus.google.com/ACCOUNT/posts', 'steffenhollstein_loc' ), "defaultValue" => "" ), // option array( "type" => "text", "id" => $themeNameShort . "_footer_socialicons_twitter", "name" => __( 'Twitter', 'steffenhollstein_loc' ), "desc" => __( 'E.g. http://twitter.com/YourAccount', 'steffenhollstein_loc' ), "defaultValue" => "" ), // option array( "type" => "text", "id" => $themeNameShort . "_footer_socialicons_pinterest", "name" => __( 'Pinterest', 'steffenhollstein_loc' ), "desc" => __( 'E.g. http://pinterest.com/USERNAME/', 'steffenhollstein_loc' ), "defaultValue" => "" ), array( "type" => "groupClose" ), array( "type" => "sectionClose" ), /*~~~ section block - END ~~~*/ ); /*~~~ Theme Options - END ~~~*/ /*~~~ add styles and scripts - BEGIN ~~~*/ function customThemeOptionsLoadStyleAndScript( $hook_suffix ){ $fileDirectory = get_bloginfo( 'template_directory' ); wp_enqueue_style( $themeNameShort . "-theme-options", $fileDirectory . "/css/theme-options.css", false, "1.0", "all" ); wp_enqueue_script( $themeNameShort . "-theme-options", $fileDirectory . "/js/theme-options.js", false, "1.0" ); } /*~~~ add styles and scripts - END ~~~*/ function customThemeOptionsInit(){ global $themeName, $themeDescription, $themeNameShort, $themeSettingsSaved, $themeSettingsReset, $options; $requestURI = $_SERVER['REQUEST_URI']; // genererate admin menue add_theme_page( $themeName, // Name of page $themeName, // Label in menu 'edit_theme_options', // Capability required $themeNameShort . "-settings", // Menu slug, used to uniquely identify the page "customThemeOptionsRenderForm" // Function that renders the options page ); // validation and update if( 'custom_themeoptions_save' == $_REQUEST['action'] ){ foreach( $options as $settings ){ $currentRequestValue = $_REQUEST[ $settings['id'] ]; if( ! isset( $currentRequestValue ) ){ $currentRequestValue = null; } $currentRequestValue = $currentRequestValue; // update option values in database update_option( $settings['id'], stripslashes( $currentRequestValue ) ); } $requestURI = str_replace( "&reset=true", "", $requestURI ); if( stristr( $requestURI, '&saved=true' ) ){ $location = $requestURI; } else { $location = $requestURI . "&saved=true"; } header( "Location: $location" ); die; } else if( 'custom_themeoptions_reset' == $_REQUEST['action'] ){ foreach( $options as $settings ){ delete_option( $settings['id'] ); } $requestURI = str_replace( "&saved=true", "", $requestURI ); $location = $requestURI . "&reset=true"; header( "Location: $location" ); die; } } function customThemeOptionsRenderForm(){ global $themeName, $themeDescription, $themeNameShort, $themeSettingsSaved, $themeSettingsReset, $options; if( ! isset( $_REQUEST['saved'] ) ){ $_REQUEST['saved'] = false; } if( ! isset( $_REQUEST['reset'] ) ){ $_REQUEST['reset'] = false; } ?>