Support » Plugins » Default options in a widget

  • wesg

    (@wesg)


    I’m updating my widget that includes many options, and in pre 2.8 wordpress, I had it all set up. Updating it for post 2.8 WP has changed many things, and i”m unsure about how to have default options for when the plugin is initially used.

    Code? Suggestions?

Viewing 1 replies (of 1 total)
  • wesg

    (@wesg)

    Nevermind, solved it.

    Declare a global array at the top of the file with default values.

    Inside the form and output function, check if the option array is empty, then sub in the defaults if it is.

Viewing 1 replies (of 1 total)
  • The topic ‘Default options in a widget’ is closed to new replies.