WordPress.org

Ready to get started?Download WordPress

Forums

Default options in a widget (2 posts)

  1. wesg
    Member
    Posted 3 years ago #

    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?

  2. wesg
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.