Paste the code :? Php // display a sub-menu add_action (admin_menu, my_plugin_menu2) in the WordPress background comment; functionmy_plugin_menu2 () {add_comments_page (data saving, data saving, read, my-unique-identifier, my_plu post the code:
// Display a sub-menu in the WordPress background comment
Add_action ('admin _ menu ', 'My _ plugin_menu2 ');
Function my_plugin_menu2 (){
Add_comments_page ('data save', 'data save', 'read', 'My-unique-identifier', 'My _ plugin_function2 ');
}
Function my_plugin_function2 ()
{
If ($ _ POST ['test _ Den '] = 'y ')
{
Update_option ('test _ input_c ', $ _ POST ['test _ input']);
// Update the database you added
?>
Saved successfully!
}
?>
Add data
Add data here.
}
// Use get_option () to display information in the database.
// The information entered above is included in the wp_options table in the database.
?>
The short code above implements the function of saving and displaying data. with this function, we can extend to other methods or functions. For example, some good themes have theme settings, and some display and storage methods can be used to implement them. you can try more. The approximate effect is shown in the following example.