Remove Admin sidebar link

function remove_featured_tax_menu() { remove_submenu_page( ‘edit.php?post_type=movies’, ‘edit-tags.php?taxonomy=featured&post_type=movies’ ); } add_action( ‘admin_menu’, ‘remove_featured_tax_menu’ );

place a direct link to custom-stylesheet, under appearance menu in wp-admin

You can check out this excellent answer by @Eugene Manuilov. In your case the relevant admin page action is: load-appearance_page_customstyle and the url to the custom stylesheet you want to edit: get_admin_url().’theme-editor.php?file=custom-stylesheet.css&theme=”. get_stylesheet().”&scrollto=0′; Then your code example would be: add_action(‘admin_menu’, ‘add_appearance_menu’); function add_appearance_menu() { add_submenu_page( ‘themes.php’, ‘Custom Stylesheet’, ‘customstyle’, ‘manage_options’, ‘customstyle’, ‘__return_null’); } add_action( ‘load-appearance_page_customstyle’, … Read more

how can I link to a PlugIn admin-sub-menu page after processing a formular

Simply use add_query_arg(), remove_query_arg() and get_query_var(). On your page link, you use a simple query var like step=one. $query_arg = add_query_arg( ‘step’, ‘one’, $_SERVER[‘REQUEST_URI’] ); Then, when the user processed the form, you just reload the page. Then simply check if 0 !== get_query_var( ‘step’ ) AND ‘one’ !== get_query_var( ‘step’ ) and process further. … Read more

Is it possible to pass variables from add_user_page?

The easiest and most clean way to solve that problem is using a specialised object. First create a class that can hold extra information: class Menu_Page { public $extra=””; public function render() { print $this->extra; } } Now create an object from that class … $page = new Menu_Page; $page->extra=”Hello World!”; … and register its … Read more

Admin Panel – Custom Menu Sub-Item LINK

Insert the URL of the page as the $menu_slug argument. Also note that user levels are deprecated, you should pass a capability instead. function add_custom_link() { add_submenu_page( ‘edit.php?post_type=cpt_custom’, ”, ‘Pending Posts’, ‘edit_posts’, ‘edit.php?post_type=cpt_custom&post_status=pending’, ” ); } add_action(‘admin_menu’, ‘add_custom_link’);

Admin doesn’t have sufficient permissions to plugin’s page

According to the documentation for add_menu_page: Note: If you’re running into the “You do not have sufficient permissions to access this page” error, then you’ve hooked too early. The hook you should use is admin_menu. This means you need to wrap your menu creation in something like: add_action( ‘admin_menu’, function() { add_menu_page( // page title … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)