Skip to content

Instantly share code, notes, and snippets.

@jazzsequence
Last active August 29, 2015 14:04
Embed
What would you like to do?
add_menu_page - correct
<?php
// this is what ACTUALLY works
public function add_options_page() {
$this->options_page = add_submenu_page( 'menu_slug', __( 'Menu Item 1', 'add-menu' ), __( 'Menu Item 1', 'add-menu' ), 'manage_options', 'menu_slug', array( $this, 'admin_page_display' );
$this->options_page = add_submenu_page( 'menu_slug', __( 'Menu Item 2', 'add-menu' ), __( 'Menu Item 2', 'add-menu' ), 'manage_options', 'a_different_menu_slug', array( $this, 'menu_item_2_function' ) );
$this->options_page = add_menu_page( __( 'Top Level Menu Title', 'add-menu' ), __( 'Top Level Menu', 'add-menu' ), 'manage_options', 'menu_slug', array( $this, 'admin_page_display' ), 'dashicons-star-filled', 12 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment