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
455
456           echo $before_widget;
457           if ( $title )
458                echo $before_title . $title . $after_title;
459
460           $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);
461
462           if ( $d ) {
463                $cat_args['show_option_none'] = __('Select Category');
464                wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));
465 ?>
466
467 <script type='text/javascript'>
468 /* <![CDATA[ */
469      var dropdown = document.getElementById("cat");
470      function onCatChange() {
471           if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
472                location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
473           }