Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Created March 6, 2017 10:29
Show Gist options
  • Select an option

  • Save hsleonis/f33448d168a624e843ce728937ca5a4b to your computer and use it in GitHub Desktop.

Select an option

Save hsleonis/f33448d168a624e843ce728937ca5a4b to your computer and use it in GitHub Desktop.
WP admin page without showing link in menu
<?php
add_action( 'admin_menu', array( $this, 'tmx_custom_admin_page' ) );
public function tmx_custom_admin_page(){
add_submenu_page( 'upload.php', __('Custom images', 'themeaxe'), __('Custom images','themeaxe'), 'manage_options', 'custom-admin-page', array($this, 'tmx_custom_admin_page_callback') );
remove_submenu_page( 'upload.php', 'custom-admin-page' );
}
public function tmx_custom_admin_page_callback() {
require_once plugin_dir_path( __FILE__ ) . 'parts/tmx_custom_admin_page_callback.php';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment