twentyeleven_theme_options_add_page

Add a theme options page to the admin menu, including some help documentation.

Description

twentyeleven_theme_options_add_page(); 

This function is attached to the admin_menu action hook.


Usage

  1. if ( !function_exists( 'twentyeleven_theme_options_add_page' ) ) { 
  2. require_once '/inc/theme-options.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentyeleven_theme_options_add_page(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/theme-options.php  
  1. function twentyeleven_theme_options_add_page() { 
  2. $theme_page = add_theme_page( 
  3. __( 'Theme Options', 'twentyeleven' ), // Name of page 
  4. __( 'Theme Options', 'twentyeleven' ), // Label in menu 
  5. 'edit_theme_options', // Capability required 
  6. 'theme_options', // Menu slug, used to uniquely identify the page 
  7. 'twentyeleven_theme_options_render_page' // Function that renders the options page 
  8. ); 
  9.  
  10. if ( ! $theme_page ) 
  11. return; 
  12.  
  13. add_action( "load-$theme_page", 'twentyeleven_theme_options_help' );