Functionality of the WordPress administration interface is handled by the files in the WP
admin directory. Let's dive a bit deeper into the code that runs on a typical WordPress admin
request and understand how it differs from a front-end request. Unlike the typical front-end
request, different PHP files are executed depending on the functionality being used.
Additionally, permalinks are not used in the admin interface, but instead query strings are used
to pass data to these locations. For example, the default URL of the admin dashboard is /wp-admin.
This will load the index.php file in the WP admin directory. However, if you want to view the posts
on your site, the URL changes to wp-admin/edit.php and this will load the edit.php file in the WP
admin directory. If you click the edit post button, the requested URL is wp-admin/post.php
and then a query string. In this case, post equals one and action equals edit.
These query string variables are then used to determine what content to display.
There are, however, a lot of commonalities in how each of these different admin files work.
Usually, the wp-admin/admin.php file is included, which sets up the WordPress environment.
This file sets up any admin specific constants
and then includes the same wp-load file that is used on the front end,
which in turn includes wp-config to include all the configuration settings for a WordPress
install and wp-settings, which sets up the WordPress environment. The admin page file
will then load any specific internal functionality, but only for the purposes of this specific section
of the admin interface. In case of the dashboard, it will include the WordPress dashboard API,
which is located at wp-admin/include/dashboard. It will then set up any specific content and
variables required for the dashboard functionality. Next, it will typically require the wp-admin/admin
header file, which performs things like setting up and rendering the header area of the admin
interface, as well as rendering the admin menu. After that, it will generate and render the content
for the specific admin page. Finally, it will require the wp-admin/admin footer file,
which sets up and renders the footer of the admin interface.