cptui_plugin_menu

Load our main menu.

Description

cptui_plugin_menu(); 

Submenu items added in version 1.1.0


Usage

  1. if ( !function_exists( 'cptui_plugin_menu' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/custom-post-type-ui.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cptui_plugin_menu(); 
  7.  

Defined (1)

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

/custom-post-type-ui.php  
  1. function cptui_plugin_menu() { 
  2.  
  3. /** 
  4. * Filters the required capability to manage CPTUI settings. 
  5. * @since 1.3.0 
  6. * @param string $value Capability required. 
  7. */ 
  8. $capability = apply_filters( 'cptui_required_capabilities', 'manage_options' ); 
  9. $parent_slug = 'cptui_main_menu'; 
  10.  
  11. add_menu_page( __( 'Custom Post Types', 'custom-post-type-ui' ), __( 'CPT UI', 'custom-post-type-ui' ), $capability, $parent_slug, 'cptui_settings', cptui_menu_icon() ); 
  12. add_submenu_page( $parent_slug, __( 'Add/Edit Post Types', 'custom-post-type-ui' ), __( 'Add/Edit Post Types', 'custom-post-type-ui' ), $capability, 'cptui_manage_post_types', 'cptui_manage_post_types' ); 
  13. add_submenu_page( $parent_slug, __( 'Add/Edit Taxonomies', 'custom-post-type-ui' ), __( 'Add/Edit Taxonomies', 'custom-post-type-ui' ), $capability, 'cptui_manage_taxonomies', 'cptui_manage_taxonomies' ); 
  14. add_submenu_page( $parent_slug, __( 'Registered Types and Taxes', 'custom-post-type-ui' ), __( 'Registered Types/Taxes', 'custom-post-type-ui' ), $capability, 'cptui_listings', 'cptui_listings' ); 
  15. add_submenu_page( $parent_slug, __( 'Custom Post Type UI Tools', 'custom-post-type-ui' ), __( 'Tools', 'custom-post-type-ui' ), $capability, 'cptui_tools', 'cptui_tools' ); 
  16. add_submenu_page( $parent_slug, __( 'Help/Support', 'custom-post-type-ui' ), __( 'Help/Support', 'custom-post-type-ui' ), $capability, 'cptui_support', 'cptui_support' ); 
  17.  
  18. /** 
  19. * Fires after the default submenu pages. 
  20. * @since 1.3.0 
  21. * @param string $value Parent slug for Custom Post Type UI menu. 
  22. * @param string $capability Capability required to manage CPTUI settings. 
  23. */ 
  24. do_action( 'cptui_extra_menu_items', $parent_slug, $capability ); 
  25.  
  26. // Remove the default one so we can add our customized version. 
  27. remove_submenu_page( $parent_slug, 'cptui_main_menu' ); 
  28. add_submenu_page( $parent_slug, __( 'About CPT UI', 'custom-post-type-ui' ), __( 'About CPT UI', 'custom-post-type-ui' ), $capability, 'cptui_main_menu', 'cptui_settings' );