As first discussed in the Processing and storing plugin configuration data recipe, some WordPress action hooks have names that contain a variable element that allows the plugin developer to get code executed when a specific page is rendered, or when data from a specific form is submitted. In this example, the load-<pagename> hook is used to register a function that gets executed when a specific administration page is accessed by the user.
Once the callback occurs, the function's code retrieves a reference to the WordPress screen object, which contains data about the screen that is currently displayed, along with a number of utility functions to manipulate and add content to the page. The code from the recipe then proceeds to register functions to render the content of two sections in the Help tab using the add_help_tab function.
The add_help_tab function is a little different from the functions that we have seen before, expecting a single array of options as its parameter. These options indicate a unique identifier for the menu section, a title to be displayed on each tab, and the name of the function that will render the tab contents. It is also possible to replace the callback argument with a parameter called content, which would directly contain the HTML code intended to be displayed in the Help tab. With this information, WordPress is able to integrate the provided HTML code when rendering the options page interface, including all of the necessary wrapper code to make the Help tab open and close, as well as allowing the user to switch between the different sections.
The other function used in this recipe, set_help_sidebar, is even simpler than add_help_tab, with a single argument indicating the HTML content to be displayed on the right-hand side of the help section.