Solution pulled from OP.
Ok fixed. In widget-config.php
there is no check if the form has been submitted, so every time you load configuration it updates with empty values or keeps default ones. Add this check if (!empty($_POST))
before updating options values and display stored value of number-input:
<input type="text" name="number" value="<?php echo self::get_dashboard_widget_option(self::wid, 'example_number'); ?>" />
Related Posts:
- WordPress 3.8 – Dashboard 1 Column Screen Options
- Extend WordPress 3.8 Site Activity Dashboard Widget to include more comments
- Indexes of widgets instances starts with ‘2’ in ‘wp_options’ table
- Embed iframe or html page into dashboard widget
- How to Remove All Widgets from Dashboard?
- How to use control_callback when creating a widget via functions.php or plugin?
- Reorder dashboard widgets
- How do I use the control callback when creating a simple dashboard plugin
- How to Make a Custom Dashboard Widget to Display Custom Notification from Admin?
- Add a banner to the Dashboard
- Different rss feeds in a single dashboard widget
- How do I pass arguments to dashboard widget callback functions?
- Add new section to “Right Now” widget
- add widgets to dashboard for easy access for clients?
- wp_count_posts, wp_count_terms and wp_count_comments for specific user?
- Widgets not expanding on wordpress 3.3 widget dashbord
- Replace dashboard widgets with banner ad
- Custom dashboard widget search box
- Hide all Dashboard Widgets (not remove)
- wp_editor is not rendering shortcode
- Dashboard Widgets – Add Admin Page With Same Functionality
- Custom User Field in Dashboard Widget
- How to make a can’t hide widget?
- Create widget in dashboard displaying a custom user field?
- Fire on widgets_init only on dashboard
- RSS dashboard widget not showing visuals
- How to create a dashboard widget for one user
- How to position custom dashboard widgets on side column
- Grabbing how Many Posts by Month for a Dashboard Widget
- Dashboard Widget drawn before opening HTML tag
- Remove “Content” and “Discussion” from Right Now Dashboard Widget
- Create Dashboard Widget with form to keep team’s record
- modifying title (in dashboard) for different widget instances
- Adding a single text input field to a custom Dashboard widget
- Adding dashboard widgets to show – custom post type stats, information from other plugins
- Change number of widget columns in dashboard?
- Allow users to give a dashboard widget a custom name using ACF
- Quick Draft widget in weird place on dashboard after being re-added
- A message to clients in the dashboard widget received from another site
- Set a dashboard widget to the top?
- Array showing all values of loop instead of specific value to post
- How can I add a widget area to the top of the Dashboard?
- How to customize WordPress dashboard for different users?
- Can I use wp_widget_rss_output to show my site’s feed in the dashboard?
- WordPress version quick check?
- Registered widget is showing up collapsed in the dashboard
- can’t edit widgets after moving from subfolder to root
- Taxonomies not showing in WP Dashboard Right Now widget
- How to make custom dashboard widget to display alert in front-end?
- How to show WordPress Dashboard Widgets on Frontend?
- class WP_Widget – Different dashboard preview for custom widget
- Unable to add options on dashboard widget ?
- Custom dashboard widget – load style only for added widget
- How to add the “page” post type to Recent Activity widget displayed in admin?
- Adding iframe Content to Sidebar Widget
- Prevent second widget activation
- How can I add links to widget titles?
- Remove rss widget title link
- Copy widget settings from one blog to another
- Sidebar Widget Registration without a name, how is it assigned to new named sidebar widget?
- Add thumbnail to recent posts widget using filters
- Is there a way to allow only certain type of widgets in the sidebars?
- How do i display the built-in gallery inside a widget?
- Forcing the title of a text widget on to a new line in the admin area
- Sidebar not show customizer!
- Customizing wordpress default widgets?
- different class (css) for sidebar widgets
- Adding widgets with Featured Image via the Customizer run hundreds of queries
- how to put functions inside of widgets
- Adding a Widget : what to put in plugin URL
- How to list all custom post types in a custom widget?
- How can I assign widgets from WP to appear in bbpress?
- get_option returns undesired blank instance of a widget
- escaping and sanitizing input for custom widget form fields
- Dynamic created widget id value of multi-instance in jQuery
- Adding Widgets to Draft Pages
- How to select multiple media files for a widget form?
- Apply code for all else first block
- dynamic sidebar in front page
- How to dynamically add the the input text field in widget?
- Header Sidebar Won’t Move Lower – Want to Align with Header Logo [closed]
- display widget checkbox selection on frontend
- Enabled checkbox by default in WordPress widgets
- Is there a way to use get_sidebar() when no widgets are activated?
- How to translate Widget Description in constructor?
- How do I customize the positioning of WordPress widgets?
- Limit archive widget results
- How can I detemine the parameters needed by the_widget()?
- Fatal error: Uncaught Error: Class ‘WP_Widget’ not found
- How can I have sidebar widgets on Twenty Seventeen theme on all pages?
- Loop through Widgets in sidebar using widget array number?
- Always show the widget title in a wordpress widget
- Custom php Widget keeps disappearing from the front end
- Display Posts by Views (Popular Posts Widget)
- Default WordPress widgets always appear
- Show editor widgets only on pages that use a specific template?
- Conditionally enable autoplay when using oEmbed in a custom widget
- Recent posts with different class name for each post and a scrollbar?
- Classic widgets with 5.9+?
- getBlockVariations(…) is undefined in Widget and Template Part editors but not Post Editor