• Resolved app1e5auce

    (@app1e5auce)


    You will need to change your author queries into taxonomy queries.

    The way this plugin works is that it turns authors into a taxonomy. When you build your own WP_Query and pass in an author the way you normally would, the plugin seems to be smart enough to turn it into a sort of taxonomy query.

    However. If you also have some custom WP_Query that includes taxonomy and author, the way in which this plugin translates the author query into a taxonomy query will break your query results.

    When making a WP_Query with a tax_query, it comes out something like this in SQL:

    AND ( 
      wp_term_relationships.term_taxonomy_id IN (346)

    It would be great if this plugin turned author queries into the above format. That would solve the problem. But instead it comes out like this:

    AND ( (wp_term_taxonomy.taxonomy = "author" AND wp_term_taxonomy.term_id = '366') )

    This breaks your custom taxonomy queries because it tries to match all your taxonomy types with the word “author”, which obviously fails.

    I’m only posting this here to hopefully help someone in the future. If you have a custom WP_Query on your site that uses both tax_query and author as parameters, change author into a tax_query to solve this problem. Just like any other taxonomy. Like this:

    [tax_query] => Array
            (
                [0] => Array
                    (
                        [taxonomy] => author
                        [field] => slug
                        [terms] => authorslughere
                    )
    
            )
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘This plugin will break any custom taxonomy + author queries on your site.’ is closed to new replies.