How to change the default url for ‘Posts’ link?

Probably the below code should help you. function myadminurl() { // generate url path to Posts -> Categories page in the admin and force http $url = admin_url( ‘edit-tags.php?taxonomy=category’, ‘http’ ); echo $url; } add_action( ‘init’, ‘myadminurl’ ); Please refer this codex for more information.

load styles and scripts in network admin not working

A bit of research on here and it seems I was trying too hard. I have found the following solution. Props to this answer. // Create admin page navigation listings function bf_carrier_admin_network() { $hook_suffix = add_submenu_page(‘settings.php’, ‘Carriers’, ‘BrightFire Carriers’, ‘edit_posts’, ‘ins-carrier-edit’, ‘carrier_admin_network’); add_action( “load-{$hook_suffix}”, ‘bfc_styles_scripts’ ); } add_action(‘network_admin_menu’, ‘bf_carrier_admin_network’); function bf_carrier_admin_display() { if (current_user_can(‘manage_options’)){ $hook_suffix … Read more

Tab order of post admin page

Form fields have something called a tab index. So when you press the tab key it will know where to go next. However when a page has multiple forms the indexes can get mixed up, unless they are clearly specified in each field. Some wp form plugins give you the ability to add the form … Read more

Restricted access for other user roles

Actually its very simple ex: // only administrator if ( ! current_user_can(‘manage_options’) ) { add_action( ‘admin_menu’, ‘remove_woocommerce_menu_pages’, 999 ); function remove_woocommerce_menu_pages() { remove_submenu_page(‘woocommerce’, ‘woocommerce_settings’); } }

How can I pass value to function in add_menu_page?

Don’t use a function for the callback, use a class. Something like this: class Competition_Manager_Page { private $extra; public function set_extra( $value ) { $this->extra = $value; } public function render() { // show you page content, then: print $this->extra; } } You can extend the class’ functionality later. Now, when you register the menu, … Read more

Link to a admin submenu item using a custom link

If I understand correctly what you are asking, you need the $menu_slug used when adding your menu pages: //add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); //add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); $your_link_url = admin_url( ‘admin.php?page=”.$menu_slug, “http’ ); OR SPECIFICALLY FOR YOU $your_link_url = admin_url( ‘admin.php?page=nes_vendor_new’, ‘http’ ); You can always verify … Read more