Adding an admin page

Some plugins add a page to wp-admin where you or the user can edit plugin options. We've seen this with W3 Total Cache, Yoast SEO, and more. Now, let's modify our plugin to give the user some control over which document types are supported. The following screenshot shows what the new management page will look like when we are done:

First, deactivate the plugin we just wrote. We'll make changes to it and then reactivate it. The following list details the steps we'll carry out to modify the plugin in order to make this new page possible:

  1. Add functions that create an admin page and save the user's input in a new option
  2. Modify the doctype_styles_new_regex() function so that it retrieves the user's input
  3. Add hooks for the admin page functions

Let's get started!