Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: widget_categories_dropdown_args

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
432
433           echo $before_widget;
434           if ( $title )
435                echo $before_title . $title . $after_title;
436
437           $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);
438
439           if ( $d ) {
440                $cat_args['show_option_none'] = __('Select Category');
441                wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));
442 ?>
443
444 <script type='text/javascript'>
445 /* <![CDATA[ */
446      var dropdown = document.getElementById("cat");
447      function onCatChange() {
448           if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
449                location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
450           }