Title: Fix for undefined index plugin errors
Last modified: August 21, 2016

---

# Fix for undefined index plugin errors

 *  Plugin Contributor [TatumCreative](https://wordpress.org/support/users/tatumcreative/)
 * (@tatumcreative)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fix-for-undefined-index-plugin-errors/)
 * // Create our drop-down category listing, using all the latest & greatest WordPress
   things
    function tc_ctf_restrict_manage_posts() {
 *  global $wp_query;
 *  $filters = tc_ctf_get_filters();
 *  foreach( $filters as $tax_slug ) {
 *  $taxonomy = get_taxonomy( $tax_slug );
 *  $value = array_key_exists($tax_slug, $wp_query->query_vars) ? $wp_query->query_vars[
   $tax_slug] : ”;
 *  $term = get_term_by( ‘slug’, $value, $taxonomy->name );
 *  $term_id = $term ? $term->term_id : ”;
 *  wp_dropdown_categories(
    array( ‘show_option_all’ => __(“Show All ” . $taxonomy-
   >labels->name ), ‘taxonomy’ => $tax_slug, ‘name’ => $tax_slug, ‘hide_empty’ =
   > false, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘selected’ => $term_id ) ); }}
 * [http://wordpress.org/plugins/tc-custom-taxonomy-filter/](http://wordpress.org/plugins/tc-custom-taxonomy-filter/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [TatumCreative](https://wordpress.org/support/users/tatumcreative/)
 * (@tatumcreative)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fix-for-undefined-index-plugin-errors/#post-4278376)
 * Well that got mangled. Let’s try this.
 *     ```
       // Create our drop-down category listing, using all the latest & greatest WordPress things
       function tc_ctf_restrict_manage_posts() {
   
           global $wp_query;
   
           $filters = tc_ctf_get_filters();
   
           foreach( $filters as $tax_slug ) {
   
               $taxonomy = get_taxonomy( $tax_slug );
   
       		$value = array_key_exists($tax_slug, $wp_query->query_vars) ? $wp_query->query_vars[$tax_slug] : '';
   
       		$term = get_term_by( 'slug', $value, $taxonomy->name );
   
       		$term_id = $term ? $term->term_id : '';
   
       		wp_dropdown_categories(
       			array(
       				'show_option_all'   => __("Show All " . $taxonomy->labels->name ),
       				'taxonomy'          => $tax_slug,
       				'name'              => $tax_slug,
       				'hide_empty'        => false,
       				'orderby'           => 'name',
       				'order'             => 'ASC',
       				'selected'          => $term_id
       			)
       		);
           }
       }
       ```
   
 *  Plugin Contributor [mrwweb](https://wordpress.org/support/users/mrwweb/)
 * (@mrwweb)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/fix-for-undefined-index-plugin-errors/#post-4278578)
 * One more tweak (end of that same file):
 *     ```
       // loop through each of the requested taxonomies
           if ( $pagenow == 'edit.php' ) {
               foreach ( $tax_queries as $tax_query ) {
                   $term = get_term_by( 'id', $tax_query['terms'][0], $tax_query['taxonomy'] );
                   $slug = $term ? $term->slug : '';
                   $query_vars[$tax_query['taxonomy']] = $slug;
               }
           }
       ```
   
 *  Plugin Author [Tracy Rotton](https://wordpress.org/support/users/taupecat/)
 * (@taupecat)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/fix-for-undefined-index-plugin-errors/#post-4278584)
 * Thanks for the pull request, guys. I’ve merged the code and submitted it to the
   repo. Please let me know if you find any other issues. If not, just mark this
   thread as “resolved.”
 * Thanks.
 * — t
 *  Plugin Contributor [mrwweb](https://wordpress.org/support/users/mrwweb/)
 * (@mrwweb)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/fix-for-undefined-index-plugin-errors/#post-4278589)
 * Both these notices and the ones in the second-most-recent thread were resolved
   by v1.3.1.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fix for undefined index plugin errors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/tc-custom-taxonomy-filter_f9f9f9.
   svg)
 * [TC Custom Taxonomy Filter](https://wordpress.org/plugins/tc-custom-taxonomy-filter/)
 * [Support Threads](https://wordpress.org/support/plugin/tc-custom-taxonomy-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/tc-custom-taxonomy-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tc-custom-taxonomy-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tc-custom-taxonomy-filter/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [mrwweb](https://wordpress.org/support/users/mrwweb/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/fix-for-undefined-index-plugin-errors/#post-4278589)
 * Status: not resolved