Categories
Wordpress

Add a theme options page

http://codex.wordpress.org/Function_Reference/add_theme_page

function theme_admin_setup() {

add_theme_page(
__( ‘Theme Options’),   // Name of page
__( ‘Theme Options’),   // Label in menu
‘edit_theme_options’,                    // Capability required
‘theme_options’,                         // Menu slug, used to uniquely identify the page
‘theme_options_page’ // Function that renders the options page
);
}

add_action(‘admin_menu’, ‘theme_admin_setup’); // must be wrapped in admin_menu
function theme_options_page() {

if ($_POST) { .. update .. }

// page for the form

}

 

Leave a Reply