Is there a way I can display all categories in the categories widget that comes with wordpress. I do not want to have to edit the core files and I want to stay away from rewriting the widget, but if need be I will. Is there anyway to hook into the widget just to get this functionality.
Not sure what you mean by 'display all categories', i thought it does that by default?
Anyways...you can hook into it, using the following filter hooks:
Both hooks pass the query args to get the categories as an array.
The default is
array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h), wherein
$h are booleans and represent if the user selected 'Show post counts' and 'Show hierarchy' in the widget's options, respectively.
The dropdown version gets another value:
$cat_args['show_option_none'] = __('Select Category');, setting the label for the 'none selected' state.
You'll can hook the same callback to both filters, so that the result is the same no matter if
Show as dropdown is selected or not.
BTW: The widgets that come with WP out of the box are defined in
wp-includes/default-widgets.php, the code in there is quite readable.