What is best practice to save persistent preferences for plugins?

hhm Member
Before I start to dissect the code of available plugins:
I'm toying around with writing a plugin in which the admin can set preferences for the plugin which he would want to be persistently stored. Is there an established way of storing such things in the database?

Best regards,
Hans

Comments

  • wongm Member
    Have a look at any of the existing plugins - they use a 'hook' for saving and reading settings. May I suggest my 'image markup generator' plugin? ;-)
    http://code.google.com/p/wongm-zenphoto-plugins/
  • acrylian Administrator, Developer
    It is a good idea to look at existing plugins as most all of theme contain preferences (we call options) right at the beginning. There is also a user guide article about plugins.
  • The best practice with regard to options is to include the plugin filename as part of the option name. This prevents duplication of options names (which would cause problems because only one of the same named options would be stored.)
  • hhm Member
    Thanks so far. I'll have a look at it and complain later if I can't get it working.
Sign In or Register to comment.