• Resolved JuniperPaul

    (@juniperpaul)


    Hi Rachel,

    Thanks for your very promising plugin!

    I created post types, then installed your plugin, then assigned relationships, however I’m finding that when I edit a CPT post I’m seeing autocomplete boxes, not checklists. Is the latter no longer your default?

    I’ll add your custom filter code but am wondering where the glitch is occurring – something I’ve done? something you’ve done? documentation needs updating? – and if there’s a way to correct it in the admin interface without having to add custom code.

    Thanks,
    Paul

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Originally, the only choice offered was the checklist. With a regular WordPress taxonomy, you get the checklist if your taxonomy is hierarchical and the autocomplete box if your taxonomy is non-hierarchical.

    In version 1.1, I added support for the autocomplete box and, in keeping with WP functionality, set it up so that you see the autocomplete if your CPT-onomy is non-hierarchical and the checklist if your CPT-onomy is hierarchical.

    At this point in time, the only way to change this default behavior is to hook into the plugin via the ‘custom_post_type_onomies_meta_box_format’ filter. I have not ruled out adding this property to the settings but, for now, the filter is the cleanest way to adjust default plugin behavior since the filter allows you to easily designate format for multiple combinations of post type and CPT-onomy.

    If you think there is a bug, please include your code and I will look into it.

    Thanks!

    Thread Starter JuniperPaul

    (@juniperpaul)

    My custom post types were set to hierarchical but I wasn’t getting checkboxes. Am I missing something? I don’t see any other place within the admin UI to set a hierarchical attribute on any object.

    Cheers,
    Paul

    Hmm. Can you include a screenshot of your settings? and of the edit CPT screen?

    Thread Starter JuniperPaul

    (@juniperpaul)

    Here are some screenshots that illustrate my situation. The problem occurs with all of the post type relationships I’ve created, but here I’ll illustrate with Merchants assigned as a taxonomy in the Artisans post:

    When I add filter code to my functions script returning ‘checklist’ when the post type name is one of my CPTs, the problem with the checklist goes away:

    add_filter( 'custom_post_type_onomies_meta_box_format', 'artsquest_custom_post_type_onomies_meta_box_format', 1, 3 );
    
    function artsquest_custom_post_type_onomies_meta_box_format( $format, $taxonomy, $post_type )
    {
    	switch ($post_type)
    	{
    		case 'aq_merchant':
    		case 'aq_artisan':
    		case 'tcp_product':
    		case 'aq_curator':
    			$format = 'checklist';
    		break;
    	}
    
    	// WordPress filters must always return a value
    	return $format;
    }

    Let me know if you need to see more.

    Thanks,
    Paul

    Thread Starter JuniperPaul

    (@juniperpaul)

    PS: Of course it’s worth noting that the post type editor I’m using here is part of the TheCartPress plugin. The custom post types it creates appear to be solid in all other respects.

    I did try creating a minimal Test post type using your plugin but that resulted in a cascade of PHP errors starting with “Warning: trim() expects parameter 1 to be string, array given in […]/wp-content/plugins/cpt-onomies/admin-settings.php on line 290” on a line referring to $cpt[ ‘capability_type’ ]. At this point I assume that the script was expecting me to fill in a field I’d left blank; I’ll explore that anon.

    A plugin conflict is a possibility but I’m hoping it’s resolvable as I’d very much like to use both TheCartPress and CPT-onomies.

    Cheers,
    Paul

    Just to double check, I know it’s set to “hierarchical” but are you 100% sure the “merchants” post type is actually hierarchical?

    I’ll be looking at my code to see if its a bug on my end.

    Is there any way to get autocomplete for hierarchical taxonomies?

    Yes, there is: Assigning CPT-onomy Terms

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Taxonomy admin boxes defaulting to autocomplete box not checklist’ is closed to new replies.