To expand on Mark’s answer, there’s not much (generally) available in the way of filters in the default WordPress widgets (except for perhaps widget_text
).
But adding your own custom widget is easy – put this in your functions.php
:
require_once("my_widget.php");
add_action("widgets_init", "my_custom_widgets_init");
function my_custom_widgets_init(){
register_widget("My_Custom_Widget_Class");
}
Then you simply want to copy the existing categories widget from wp-includes/widgets/class-wp-widget-categories.php
to my_widget.php
in your theme, and change the class name to the same name as that used in the call to register_widget()
above.
Then make whatever changes you like! I suggest changing the title too so you can distinguish it from the default Categories widget.
Related Posts:
- How to hook into unregistering a widget instance?
- Filter Widget Title Wrap
- Is it possible to remove the filter from 4.8 text widget?
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- WordPress tag cloud add more links
- How to add a class to Tag cloud widget link?
- How to make a widget expand wider than the column width when editing its settings in the admin
- Warning: Missing argument 2 for widget_title filter
- Add Bootstrap Classes to Recent Posts Widget
- include specific Pages to wp_list_pages with filter
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- I’ve set up an extra field for all the available widgets. How do I show it’s value in the front-end?
- Archive Widget – Count only parent posts
- Widget image reorganize layout
- How can I change the button text of a custom widget?
- WordPress Tag Cloud Filter Prevents Widget HTML from loading
- How can I add a prefix to titles displayed in sidebar using function.php?
- Filter WordPress Archive Widget to exclude posts with specific custom taxonomy term id
- Output dynamic_sidebar_params in wp_head
- Filter on widget-title does not work with custom links
- How to use apply_filters(‘get_calendar’) to change get_calendar() output?
- Filter widget_pages_args not working in Pages Widget
- Insert HTML just after tag
- the_content and is_main_query
- How to Pass External Variables to Filters/Actions
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Extend WordPress 3.8 Site Activity Dashboard Widget to include more comments
- Filter username field on registration for profanity and unwanted words
- At what priority does add_filter overwrite core functions?
- Add whitespace between Chinese and other letters
- How to add icons to post listing (edit.php) in admin
- Translating an error message
- How to add a filter to all widget output
- Keep Users Logged In As Long As I Like
- Display WooCommerce newest product reviews on top [closed]
- Overriding wp_get_archives() apply_filters()
- How to make post and comment count unclickable with dashboard_glance_items hook
- Call to undefined function error after adding add_filter to wp-config
- Add Dropdown menu using “add_filter => wp_nav_menu_items”
- Filtering ‘the_title’ with option to return subhead?
- How to add a custom filter in functions.php
- Setting title using wp_title filter
- What functions are included in apply_filter(‘the_content’)
- Filtering admin entries for custom post type
- What hook/filter can I use to add/edit/show/hide the title under (on hover) links on the table view?
- option_active_plugins filter not working
- Anonymous function is executed twice in wp_head while added from the_posts filter?
- add_filter return value
- Hide content editor for posts after approriate date
- Why my admin doesn’t work after adding rest_prepare_post filter?
- How to make a button?
- How do I filter title and alt attributes in the gallery shortcode?
- Same Conditionals Not Working on Two Different Hooks
- Filter get_template_part() $args array
- Modify a Filters Second Parameter
- Filtering post-formats from the loop using new WP-Query();
- Insert term when page is published – avoid duplicates after edits
- Filter Media by Featured on Admin
- How to add a filter to get_the_author_meta?
- page_attributes_dropdown_pages_args filter does not work
- What different ways can a plugin add a filter to a WordPress site?
- How to access plugin variables from theme templates without using globals?
- Make an array filterable per hook
- add img class to native wordpress galleries
- Get Posts updated or published within the last x hours
- WP filter to alter admin CSS styles?
- preview_post_link for Custom Post Types
- Filter an array with a callback – for single & multidimensional arrays
- Detect when gutenberg editor title is available in Dom after editor load
- Why this filter hook is not working when passing parameters?
- Are href attributes of a elements filtered on output to add the current path?
- Add a filter to an action [closed]
- Change the template when the user is not logged in using page_template filter (it does not work)
- Regarding post text filtering
- Add Filter not working with get_posts
- How to Prevent WordPress to encode html in post?
- Why template_include filter does not work with WPML plugin?
- Filter posts by meta data using custom query
- Most performant/functional way to add actions/filters?
- Making an add_filter() call from within an add_filter() call
- Action hook to control access to certain parts of my site
- Finding actual functions added to hooks and filters
- How to apply filter on get_the_post_thumbnail()
- How can I tranlslate post date in italian?
- Use alternative front page if cookie is set
- How do I check if I can use the allowed_block_types filter?
- Use a functions in functions.php to remove a string for template theme
- Setting the page title in a plugin, but not outside my plugin
- how to output HTML tags in post_content and not as plain text
- Security question – Display a General Custom Login Error Message
- Add filter conditionally to a page
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- changing size image within the content
- Remove action added from class
- Identify admin/logout and more filters
- Sanitizing a custom query’s clauses
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- How to create a list of terms who’s posts also have a predefined external term?