WordPress.org

Forums

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

  1. subigya
    Member
    Posted 1 year 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(
            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.

    http://wordpress.org/plugins/cpt-onomies/

  2. Rachel Carden
    Member
    Plugin Author

    Posted 1 year 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.

    Thanks!

  3. subigya
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

    Same problem for me, same fix working !
    Thanks Rachel

  5. Earthman Web & Media
    Member
    Posted 6 months 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