• WP is throwing some PHP Notices in get_term_link() because it’s not finding the expected object property. And the function returns an incomplete link.

    PHP Notice: Trying to get property of non-object in /wp-includes/taxonomy.php on line 2891

    $taxonomy = $term->taxonomy; // line 2891

    PHP Notice: Undefined property: stdClass::$taxonomy in /wp-includes/taxonomy.php on line 2901

    elseif ( $t->query_var ) // line 2901

    The reason for this is that the $term object doesn’t contain the expected property, because the alias in the plugin’s sql query is “_taxonomy”:

    SELECT ... tt.taxonomy AS _taxonomy (sitemap-core.php line 2126)

    Then inside get_term_link() the code branches to line 2904 and produces an incomplete link because $taxonomy is empty

    $termlink = "?taxonomy=$taxonomy&term=$slug"; // line 2904

Viewing 1 replies (of 1 total)
  • Thread Starter kilobytes

    (@kilobytes)

    Oops.. I’m still having trouble posting this in the right forum. It should be [Plugin: Google XML Sitemaps]… Can the Mod do that or should I create yet another thread?

Viewing 1 replies (of 1 total)
  • The topic ‘Custom taxonomies create bad links’ is closed to new replies.