add_page_menu to make shortcut to widgets

You can add a link to the widgets.php like that: add_action( ‘admin_menu’, ‘f711_add_widgets_shortcut’, 999 ); function f711_add_widgets_shortcut() { add_menu_page( ‘Widgets’, ‘Widgets’, ‘publish_pages’, ‘widgets.php’, ”, ”, 61 ); } Be sure to check your permission settings, and you may also include another image. You can find the documentation about the function at The Codex.

How to avoid creating first submenu page that is same as menu page?

You can set slug of a subpage to be the same as slug of parent page. For example: public function onixion_admin_menu_option() { add_menu_page(‘onixion’, ‘Onixion’, ‘manage_options’, ‘onixion-admin-menu’, array(&$this, ‘onixion_main_page’ ), ‘dashicons-chart-area’, ‘200’ ); add_submenu_page( ‘onixion-admin-menu’, ‘scripts’, ‘Scripts’, ‘manage_options’, ‘onixion-admin-menu’, // <– here we set the same slug as for parent page array(&$this, ‘onixion_scripts_page’ ) ); add_submenu_page( … Read more

add_menu_page with no link

You can use add_menu_page() to add the link yourself. Simply use # as menu slug. You can then use add_submenu_page() to add the other menu items yourself. Another option would be to to fiddle with the global $menu array. Take this answer as base. Edit: As per the comments, there needs to a top & … Read more

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