In the method “widget” look for the line that sets the category then add either:
$cat = empty($instance['cat']) ? 'N/A' : $instance['cat'];
(where you replace N/A with something you like) or… better… add a filter instead like this:
$cat = apply_filters( 'widget_my_cat', empty($instance['cat']) ? 'N/A' : $instance['cat'], $instance, $this->id_base);
And then hook into ‘widget_my_cat’ to set it to something else if the value is ‘N/A’
Related Posts:
- WordPress: Apply filter/hook to a particular sidebar widgets?
- Disable widgets on specific posts
- Excluding specific widgets from default sidebar class
- Programmatically add widgets to sidebars
- Loading scripts only if a particular shortcode or widget is present
- Give Editor Access To Sidebar
- Where is the content of widgets stored in mysql table
- Get number of widgets in sidebar
- Extend WordPress 3.8 Site Activity Dashboard Widget to include more comments
- Add the sidebar/widget editor to the post edit screen?
- Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?
- Add filter to blogroll widget
- Different widgets on different page templates?
- Widgets not displaying in theme customizer
- Register multiple sidebars
- How to add author details in the post sidebar?
- How to add a filter to all widget output
- Determining a Widget Instance and Sidebar Location?
- Randomize widgets displayed in my sidebar [duplicate]
- Woocommerce Product Category Widget – hide categories that have no products in stock [closed]
- Add div class to only one widget
- Add class to before_widget for all widgets with a dropdown and a counter
- Add a select box to all widgets
- How to avoid widgets added to sidebar on theme activation?
- How to exclude certain widget from showing up on home/front page? [duplicate]
- Unfiltered html in widget title not working
- Display sidebar that created in functions.php
- Create variable from widget instance
- Save/update widget outside admin panel [closed]
- Why use dynamic_sidebar() conditionally?
- wordpress widget textbox in the sidebar
- WordPress Widget multiple use
- Contact Form in sidebar [closed]
- More flexible sidebar and widget management
- dynamic_sidebar() returns false in admin section
- duplicate sidebar
- How to check if searchform.php is being included as widget?
- How to get sidebar’s content inside admin-ajax?
- Removing custom widget area WordPress 4.4 [closed]
- Full width layout for custom post type pages
- How to “pair” two widgets side by side in one sidebar [closed]
- Adding custom html and standard widgets to sidebar
- Dynamic Sidebars On Multiple Subpages
- How to add new sidebar widget area to child theme?
- Cannot save widgets in custom sidebars
- Check which registered sidebar a widget is added to
- Display the id list of active widgets of same sidebar?
- How to remove a widget from the sidebar on specific page?
- Add individual tag to widget title in sidebar
- Can’t see widget areas in my customizer
- Need help using a filter on the default Categories widget
- Widgets not activated alert after using get_sidebar()
- How to show different widgets on different pages in a user friendly way
- Trying to create dynamic widget area using post ID
- Can you target a widget_class in a register_sidebar?
- Default widgets assignment – isn’t working
- Copy Widget Settings because of changed IDs
- Programmatically add widgets to sidebars
- Programmatically add widgets to sidebars
- How to call widget by widget’s id?
- wp_get_attachment_image() not displaying post images even though wp_get_attachment_url() echo correct urls
- Show a widget as a sidebar fallback
- register_sidebar fails when using a include within functions.php
- Add a specific css to a widget
- what is the best way to add things to a side bar
- Is there a simple way to have a new sidebar for each page?
- how to add the same Widget twice to a sidebar?
- Add class to on sidebar widget
- My widget not printing before_widgets and after widgets
- How to append custom text to the output of ‘categories widget’?
- Multiple rows of footer widget areas
- Output column number according to active sidebars
- Check if widget is inside sidebar with PHP
- New Widget are not showing
- Why would apply_filters return a non-empty string, when the value returned is empty?
- How do I exclude portrait pictures from the nextgen gallery sidebar widget?
- Upgraded to 3.3, My Widgets Disappeared
- changing the style of sidebar
- Need to delete the sidebar widget area and have the page a full page rather than just have a blank widget area
- Before_widget won’t show up
- How can I add a prefix to titles displayed in sidebar using function.php?
- Reposition the widget sidebar in Appearance->Widgets
- Handling dozens of sidebars
- Does current page contain widget or sidebar
- widgets_init actions not fired from functions.php’s child theme
- Active Sidebar Conditional Question?
- Target logic based on Widget / Sidebar Name
- Paginate recent posts widget
- Add sidebar in inner pages
- $before/after_widget/title not displaying anything
- Pass widget variable to external function
- Inkness theme sidebar
- Automatically hide Widgets that would lengthen page
- Single Widget Multi Sidebar
- Unique widget id in sidebar
- How to exclude a widget from showing up on a page?
- How to hide sidebar widgets in all pages except Hompage?
- Keeping shortcode-generated widget and theme element in one line [closed]
- Add custom settings to widget areas
- Can’t edit the widgets sidebar or footer