Title: Making Plugins &#8211; Database
Last modified: August 18, 2016

---

# Making Plugins – Database

 *  [snareklutz](https://wordpress.org/support/users/snareklutz/)
 * (@snareklutz)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/making-plugins-database/)
 * Hi,
    I was reading the codex when I came up to reading about how to Save Plugin
   Data: [http://codex.wordpress.org/Writing_a_Plugin#Saving_Plugin_Data_to_the_Database](http://codex.wordpress.org/Writing_a_Plugin#Saving_Plugin_Data_to_the_Database).
 * For the add_option function, there are 4 variables but no real description for
   each…what are they?
 * Also, if I were to make a admin panel, will all user types be able to see it?
   If yes, how do I make only the global admin able to see it?
 * Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [jaredquinn](https://wordpress.org/support/users/jaredquinn/)
 * (@jaredquinn)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/making-plugins-database/#post-297822)
 * The add_, update_ and get_ option functions are used for “configuration” values
   for plugins.
 * The options for add_option are:
 * add_option($name, $value, $description, $autoload);
 * $name = name of the option
    $value = the value you want set $description = a 
   description of this optioin $autoload = autoload this setting
 * If autoload is set (default yes) then the setting is automatically retrieved 
   by the get_alloptions function.
 * You will want to add a page to either the ‘options’ or ‘manage’ section of the
   admin interface for your admin panel.
 * For these you would use add_options_page or add_management_page respectively.
 * Syntax:
 * add_options_page(page_title, menu_title, access_level, file, [function]);
 * or
 * add_management_page(page_title, menu_title, access_level, file, [function]);
 * e.g.
 * add_options_page(‘Test Options’, ‘Test Options’, 8, __FILE__, ‘functiontocall’);
 * (note: __FILE__ can be used to mean “this current plugin file” handles the display
   of options. The ‘functiontocall’ is called to display/save/set etc the options.)
 * There is more good info, as usual, in the codex.. [http://codex.wordpress.org/Adding_Administration_Menus](http://codex.wordpress.org/Adding_Administration_Menus)
 *  Thread Starter [snareklutz](https://wordpress.org/support/users/snareklutz/)
 * (@snareklutz)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/making-plugins-database/#post-298390)
 * About Adding Administration Menus, does the code need to be run every single 
   time the plugin runs, or just the first time?
 *  Thread Starter [snareklutz](https://wordpress.org/support/users/snareklutz/)
 * (@snareklutz)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/making-plugins-database/#post-298391)
 * Never mind, I’ve found out — you can run it every time and it’ll be fine. One
   question though, what does get_alloptions do?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Making Plugins – Database’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [snareklutz](https://wordpress.org/support/users/snareklutz/)
 * Last activity: [20 years, 5 months ago](https://wordpress.org/support/topic/making-plugins-database/#post-298391)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
