Adding a menu item in the admin bar

every menu have an number . lower the number priority. add_action( ‘admin_bar_menu’, ‘wp_admin_bar_sidebar_toggle’, 0 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_wp_menu’, 10 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_sites_menu’, 20 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_site_menu’, 30 ); more clear idea you can check the link below http://natko.com/custom-menu-item-position-in-wordpress-admin-bar-toolbar/

Remove Pagination in Appearance -> Menus -> Categories

As per Stackoverflow Stackoverflow Ok after reading through the source code I found that the number of categories returned in the edit menu section is hardcoded to 50 on line 613 of \wp-admin\includes\nav-menu.php // Paginate browsing for large numbers of objects. $per_page = 50; $pagenum = isset( $_REQUEST[$taxonomy_name . ‘-tab’] ) && isset( $_REQUEST[‘paged’] ) … Read more

Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?

Your menu slug (5th parameter) can’t be the same across multiple pages, and it obviously can’t have an & in it, but you can have all the pages you want call the same callback function (the last param). add_submenu_page(‘upload_manage’, “Programs”, “Programs”, ‘manage_options’, ‘manage-programs’, “manage_data”); add_submenu_page(‘upload_manage’, “Schedule”, “Schedule”, ‘manage_options’, ‘manage-schedule’, “manage_data”); Then in the manage_data function, … Read more

How Can I remove or hide the export page in WordPress menu?

Whenever in doubt about a WordPress function, consult the Codex: Function_Reference/remove_menu_page. The correct function is remove_submenu_page hooked into admin_menu. add_action( ‘admin_menu’, ‘remove_submenu_wpse_82873’ ); function remove_submenu_wpse_82873() { global $current_user; get_currentuserinfo(); // If user not Super Admin remove export page if ( !is_super_admin() ) { remove_submenu_page( ‘tools.php’, ‘export.php’ ); } } And then you’d probably would like … Read more

How to create sub menu with a URL parameter?

You’d have to manipulate the global $submenu and modify the link in it. Or use jQuery. The following example adds a submenu in the Dashboard menu and changes the destination link just after. The submenu page will dump the contents of the global var. add_action( ‘admin_menu’, function() { add_submenu_page( ‘index.php’, ‘Sandbox Options’, ‘Options’, ‘administrator’, ‘sandbox_options’, … Read more

Admin sidebar items overlapping in admin panel

This is a known issue. The current fix (which may also make it into core) looks like this: add_action( ‘admin_enqueue_scripts’, ‘chrome_fix’ ); function chrome_fix() { if ( strpos( $_SERVER[ ‘HTTP_USER_AGENT’ ], ‘Chrome’ ) !== false ) { wp_add_inline_style( ‘wp-admin’, ‘#adminmenu { transform: translateZ(0) }’ ); } }

How to add a new plugin page under desired Options page?

Use add_submenu_page instead. <?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); ?> $parent_slug should be one of the following For Dashboard: add_submenu_page( ‘index.php’, … ); Also see add_dashboard_page() For Posts: add_submenu_page( ‘edit.php’, … ); Also see Also see add_posts_page() For Media: add_submenu_page( ‘upload.php’, … ); Also see add_media_page() For Links: add_submenu_page( ‘link-manager.php’, … ); … Read more

Is it OK to move admin menu items?

this might work: add_filter(‘custom_menu_order’, ‘my_custom_menu_order’); add_filter(‘menu_order’, ‘my_custom_menu_order’); function my_custom_menu_order($menu_ord) { if (!$menu_ord) return true; return array( ‘index.php’, // the dashboard link ‘edit.php?post_type=custom_post_type’, ‘edit.php?post_type=page’, ‘edit.php’ // posts // add anything else you want, just get the url ); }

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