Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'admin_init', 'DWM_theme_options_init' );
- add_action( 'admin_menu', 'DWM_theme_options_add_page' );
- function DWM_theme_options_init(){
- register_setting( 'DWM_theme_options', 'DWM_theme_options');
- }
- function DWM_theme_options_add_page() {
- add_theme_page( __( 'DWM Theme Options', 'dwmtheme' ), __( 'DWM Theme Options', 'dwmtheme' ), 'edit_theme_options', 'theme_options', 'DWM_theme_options_do_page' );
- }
- function DWM_theme_options_do_page() {
- global $select_options;
- if ( ! isset( $_REQUEST['settings-updated'] ) ) $_REQUEST['settings-updated'] = false;
- // OPTION PAGE HEADER
- ?>
- <div>
- <?php screen_icon(); echo "<h2>". __( 'Custom Theme Options', 'dwmtheme' ) . "</h2>"; ?>
- <?php if ( false !== $_REQUEST['settings-updated'] ) : ?>
- <div>
- <p><strong><?php _e( 'Options saved', 'dwmtheme' ); ?></strong></p></div>
- <?php endif;
- // END OPTION PAGE HEADER
- ?>
- <form method="post" action="options.php">
- <?php
- settings_fields( 'DWM_theme_options' );
- $options = get_option( 'DWM_theme_options' );
- ?>
- <tr valign="top"><th scope="row">
- <?php _e( 'Additional Header info', 'dwmtheme' ); ?></th>
- <td>
- <input id="DWM_theme_options[additionalheaderinfo]" name="DWM_theme_options[additionalheaderinfo]" type="checkbox" value="1"
- <?php checked( '1', $options['additionalheaderinfo'] ); ?>
- </td>
- </tr>
- <p>
- <input type="submit" value="<?php _e( 'Save Options', 'dwmtheme' ); ?>" />
- </p>
- </form>
- </div>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement