You should use isset
$id = isset( $instance['id'] ) ? esc_attr( $instance['id'] ) : '';
$number = isset( $instance['number'] ) ? esc_attr( $instance['number'] ) : '';
Related Posts:
- Limit number of Widgets in Sidebars
- How to load Widget javascript + css files only if used?
- check if registered sidebar is active & has widget content
- How to use wp_dequeue_style() for style enqueued in WP_Widget class
- Storing custom dashboard widget options in wordpress
- Programmatically edit the text of a widget
- Shortcode from a widget is wrapped in unwanted element
- How to update widget from widget() function?
- Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?
- Customized widget area – how to override or filter class xoxo?
- Unable to get Alert function to consistently work with backend widget with latest WP
- How to add a description to Widgets?
- Widget options get
- Insert custom content before widget title/after widget opening tag
- Custom Menus, Widgets & Conditional Statements
- Dynamic widgets
- How do I stop a widget from displaying on mobile site?
- cannot drag and drop widgets since wordpress 3.2.1
- Show widget when not using SSL
- How/where is the global variable $wp_registered_widgets filled?
- Converting a WordPress widget to a block
- Change recent posts widget title
- Color Picker Showing Twice When Widget Added to Sidebar
- How can I use AJAX to save/update a widget form?
- Hide all Dashboard Widgets (not remove)
- Widget modifications in a child theme
- How to get “Widget Logic” plugin’s input value in a custom widget code (to display on the Widget admin page)
- Making footer widgets responsive
- Custom html widget with a Joomla-style assigment
- Form link throwing website to main language
- Is there a way to extend the default image widget into a new custom widget and add additional fields to it?
- Conditional Tags Based on Previously Viewed Posts
- Make page jumps in widget
- Create widget in dashboard displaying a custom user field?
- Widget without DIV wrapper
- Widgets not displaying since 4.3
- Custom widget with WYSIWYG
- Limit number of widgets in widget area
- How to create pagination for homepage with widgetized area?
- Hooking action once but called twice
- How to update the widget form when the image is selected?
- How can I add an author-box below a post?
- How to overload the update() of existings widgets?
- Override WordPress Widget CSS Classes?
- Is there a WordPress widget for my webpage?
- Validating widget’s configuration data on Admin page
- FTP Widget Location
- Turn off “This is the Primary Sidebar Widget Area” message
- Inserting Read More Tag in Widget
- Adding a WordPress Widget to a settings page
- Display posts from category in post content?
- Is there any tab widget plugin supporting third party widgets? [closed]
- Add footer widgets
- Widgets in WP 4.3 disappearing – How to fix?
- Making jQuery .change() event persistent after widget save
- Widget background images missing on second blog excerpt page
- How should I add a “widget” like element?
- Custom CSS for a particular text/html widget in WordPress
- Removing side bar widgets from GovPress theme
- What conditional to use for dynamic sidebar check?
- how to show only particular category post in archive widgets
- How to test if the widgetized area has any widgets?
- Saving widget gets an undefined variable
- Trouble accessing a multidimensional array to add classes to default WordPress widgets
- Distinguish between different widgets of the same type
- links to Media Library content in sidebar per page
- Why is registering a sidebar for each page causing my sidebars to reset?
- widgets in footer?
- Can you hide a widget based on its content?
- Quick Draft widget in weird place on dashboard after being re-added
- How can I remove WordPress element IDs and Class names in the HTML?
- Remove widgets on mobile front page without affecting desktop
- Widget not appearing in customizer
- Widget display nothing
- Collapsible widgets [closed]
- Widget settings disappear after refresh
- How to display author meta in a sidebar widget
- Is it ok not to set widget in the main page of a one page WordPress Theme?
- How to get widget content in WordPress based on it’s ID?
- Recent Posts Widget URL / Domain change
- New Custom Widget Call a Different Widget Function
- Loading scripts only if a particular shortcode or widget is present
- Make a widget to my footer
- How to change text of a widget depend on condition?
- Add space to the end on a widget
- Insert to wp_footer if widget is found in the sidebar
- Using javascript on the new widget preview / customizer page
- Options page for widget
- user definable sidebar per page
- List.js inside WordPress widget
- Show or hide custom menu widget in side bar conditionally
- Custom tabs widget don’t work in google chrome, is blocked, do not change the tabs. Why?
- WordPress Hide Widget If $_Session Is Active?
- Post Thumbnails on Sidebar Widgets
- Widget which displays thumbnails, but links to urls?
- Using Conditional Tags to restrict something to 1 user?
- Recent posts with different class name for each post and a scrollbar?
- Problem on register/login widgets
- Unable to add options on dashboard widget ?
- is it possible to create custom widgets page in admin?