WordPress.org

Support

Support » Plugins and Hacks » Hacks » Widget Default Values

Widget Default Values

  • I can’t find any documentation for widget development that explains how to create default values for widgets that are created by extending the WP-Widget class.

    How do you set default values for new instances of your widget?

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    @esmi

    Forum Moderator

    Thanks for the link, but it looks like that just sets up the default values in the form. If the user doesn’t then click the “save” button, those defaults won’t be saved and the widget will still be configured with blank values.

    Is there any way to store default values without having the user save the widget? In the method used prior to 2.8, you could put the widget’s defaults in the options table upon plugin activation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Widget Default Values’ is closed to new replies.
Skip to toolbar