Ночной режим / Night mode

One of the main stages in the development of WordPress is considered to be the familiarity with the menu system, which is closely related to Settings API. For the system to function correctly you need to deal with :WordPress API and display it in the admin panel. This article provides basic tips and guidelines to using the WordPress menu, as well as which option will be appropriate in a given situation.

Variety menu

Submitted to WordPress in 4 different ways on the menu, for successful integration of which is necessary to get acquainted with key features of their work:

1. Top-level menu. To create links to your own page using the add_menu_page function, which plays the role of hook. Configured this menu item as follows:

At the bottom of your WordPress admin add new menu;
Set the name within the selected theme;
Make this menu item available to all users;
Create a new menu item without icon;

2. Submenu. At this stage, check the sub-items in the previously created menu using add_submenu_page:

Registers the menu item;
Was the sub-item should display the contents of “Options”
Open access for all users;
Subparagraph shall be without icons;

3. The plugins page. Function add_plugins_page similar to the previous function, but there are 2 differences:

The feature was designed to create new plugins.
It allows you to add a menu item directly in menu “Plugins”;

4. Page topics. In this case, you will need to work with the add_theme_page function, which is similar to the same feature for themes and sub-menus.

The main purpose of each function

Despite the fact that the responsibility for the integration settings lies with the developer, the user needs to learn in advance a quick guide to configuring each function:

Top-level menu can be added only in those cases when there are multiple submenus, and they can be logically grouped. This option is most relevant when there is a certain group of settings which logically can be transferred to one of the WordPress menu;
Regardless of the settings sub-menu always belongs to the main top-level menu. Submenu always grouped according to a special logic. If the user has the ability to add existing submenus in the top menu, then you definitely should do that. Never need to clutter the top-level menu unnecessary items;
The plugins menu is most important in the case where the user has a simple option. But when it comes to multiple pages, then it is better to give preference tab navigation or just to create a single top level menu;
The menu of topics is presented in the form of a set of special options that need to create their own topics. When all options can be placed on one page, then it is best to use the WordPress API function, otherwise can not do without the tab navigation.

In the end you can add that functionality in WordPress allows you to add any function to an existing menu, but some designers still do not approve of these innovations. They believe that the custom menu should not overlap with the main points of the Executive core. In any case, all depends on the user, the most important – to make any amendment with knowledge of possible consequences.