Worthy of attention. We will draw a lot about the following methods taken by the latter. We must carry out three tasks immediately. The
Add the options page to the settings menu. Pin the link to this page on the existing plug-in management screen. In fact, the page is created on the back end. This is really an administrator type problem, so according to the experience so far, \/my-rdm-quotes\/admin\/class-my-rdm-quotes-admin. You will go directly to the base class of PHP. Use add\u options\u page() to manage the menu, use add\u action\u links() to connect to the existing plug-in page, and refresh the rendering of the actual page\/**
*Register the management menu of the plug-in in the word press dashboard menu.
*The
*Starting with 1.0.0
*\/The
Public function add\plugin\admin\menu(){
Add\u options\u page (\
}The
\/**The
*Add the setup task link to the plug-in page.
*The
*Starting with 1.0.0
*\/The
Public function add_action_links ($links){
$settings_link= array(
‘maleplugin_name). ‘ \
);
Return array_merge ($settings_link, $links);
}The
\/**The
*Render the settings page for the plug-in.
*The
*Starting with 1.0.0
*\/The
Public function display\u plugin\u setup\u page(){
Include_once (‘partials\/my-rdm-quotes-admin-display.php’);
}\/The part of the admin folder uses the same method as the top of the \/public folder. However, if you access the back end in this step, you will not be able to see the entire back end. We still need to tell the main class what is actually going on\/ Includes \/ class my RDM quotes Back to PHP, quickly add it to our define_admin_hooks() function:
\/\/Add menu item
$this->loader->add\u action (‘admin\menu’, $plugin\admin,’add\plugin\admin\menu’);
\/\/Add Settings link to plug-in
$plugin\u basename = plugin\u basename (plugin\u dir\u path (\u dir\u)$ This->plugin_name.’ Php’);
$this->loader->add\u filter (‘plugin\u action\u links\’. $plugin\u basename, $plugin\u admin,’add\u action\u links’);
Now, when you return to the administrator, you are almost done. The
We are getting there slowly, but it still doesn’t make much sense to click on one of the links. Time to fill the last blank. Add optional fields to avoid getting lost in the ocean of unnecessary details, we will keep it very brief here. The single option provided to the user is the global option, which is used to show or not show the title in quotation marks. This is a simple check box. As you can see from the above code, we set this task to \/admin\/my-rdm-quote-admin-display. Will be executed in the PHP file. This file already exists conveniently (though rarely). Let’s enter some code. The
Male
Male male
Male
Male plugin_name);? >
Male
Male
The list of quotation marks contains the title