The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

TC Custom Taxonomy Filter
Debug errors - lines 27 & 37 (2 posts)

  1. iso200
    Posted 3 years ago #

    I'm getting the following errors when I have this plugin installed and go to wordpress/wp-admin/edit.php :

    Notice: Undefined index: country in /Volumes/Users/me/Sites/MAMP/local_test/wordpress/wp-content/plugins/tc-custom-taxonomy-filter/tc-custom-taxonomy-filter.php on line 27

    Notice: Trying to get property of non-object in /Volumes/me/me/Sites/MAMP/local_test/wordpress/wp-content/plugins/tc-custom-taxonomy-filter/tc-custom-taxonomy-filter.php on line 37

    Adding the following before and after line 27 sorts this:
    if (!isset($wp_query->query_vars[$tax_slug])) $wp_query->query_vars[$tax_slug] = "";
    $term = get_term_by( 'slug', $wp_query->query_vars[$tax_slug], $taxonomy->name );
    if (!isset($term->term_id)) $term->term_id = 0;

    solves this for me.


  2. Tracy Rotton
    Plugin Author

    Posted 3 years ago #

    Thanks for the heads up.

    While your code does solve the errors that are viewable, it leaves an empty select element, which I don't think looks very good. I'll work on fixing both of these issues and having an update in a few days.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • TC Custom Taxonomy Filter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic