You can use the wordpress Options API without the Settings API (but you can’t use Settings API without Options API)

Store a value or array

  $MyStoredSetting = "something...";

  update_option('MY_UNIQUE_SETTING_NAME', $MyStoredSetting , True);       //If the option does not exist it will be created.  autoload=True(load the option when WordPress starts up)

Read stored value or array

You don’t have to stored a value first, get_option() will return False if none found.

$MyStoredSetting can be a value or an array, get_option() will serialise it if necessary

  
  if (!$MyStoredSetting = get_option('MY_UNIQUE_SETTING_NAME'))
    $MyStoredSetting = "";

Delete a stored setting

  delete_option('MY_UNIQUE_SETTING_NAME');

Add a new stored setting

You can use this if you wish, but update_option() will create a new setting if it doesn’t already exist

  add_option('MY_UNIQUE_SETTING_NAME', 'options_value', True);       //autoload=True(load the option when WordPress starts up)
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published.