CPT-onomies: Using Custom Post Types as Taxonomies
[resolved] mashup with tax_query not working on 1.3.1 (5 posts)

  1. subigya
    Posted 2 years ago #

    Hi :) I just encountered a very interesting problem. The following code works fine upto 1.3, but it doesn't work on 1.3.1.

    $args1 = array (
          'post_type' => 'faculty',
          'posts_per_page'=> -1,
          'tax_query' => array(
              'taxonomy' => 'divisions', // This is the CPTnomies related taxonomy
              'field'    => 'term_id',
              'terms'    => $term->term_id
         'faculty_type'	=> 'division-director' // This is a custom taxonomy for custom post type faculty

    This code works perfectly fine upto 1.3. On 1.3.1, i couldn't get this to work, even after having both taxonomies with a 'relation' => 'AND' query between the two tax queries.

    Somehow on 1.3.1, i can't seem to create a relation between custom taxonomy and a cptonomies taxonomy!

    Thank you.


  2. Rachel Carden
    Plugin Author

    Posted 2 years ago #

    I think I know what the problem is. And it's my fault. I'm sorry. I had a feeling about this code and here's why.

    For the time being, make the following fix and I'll get it sorted ASAP.

    Go into manager.php file and change line 323-324 to:

    $is_registered_cpt_onomy = $this->is_registered_cpt_onomy( $taxonomy );

    Please let me know if that fixed it so I'll know what to do on my end.


  3. subigya
    Posted 2 years ago #

    That fixed it! Thank you.

    //if ( ! ( $is_registered_cpt_onomy = $this->is_registered_cpt_onomy( $taxonomy ) ) )
    //	continue;
    $is_registered_cpt_onomy = $this->is_registered_cpt_onomy( $taxonomy );
  4. JudeAAZ
    Posted 2 years ago #

    Same problem for me, same fix working !
    Thanks Rachel

  5. Earthman Web & Media
    Posted 1 year ago #

    Thanks, this one killed a couple hours for me until I finally found this. Might be good to include this in the docs on your site.

    will this be included in the next plugin update, please?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic