WordPress.org

Ready to get started?Download WordPress

Forums

Widgets Reloaded
Listing custom taxonomy terms (4 posts)

  1. Ivaylo Draganov
    Member
    Posted 3 years ago #

    This is a great plugin but I was trying to list terms from a hierarchical custom taxonomy and the problem was that it was not listed in the taxonomy dropdown.

    Looking into the code I found the problem on line 139:

    $taxonomies = get_taxonomies( array( 'show_tagcloud' => true ), 'objects' );

    show_tagcloud causes get_taxonomies to return only tag-like taxonomies. I decided to go for a quick fix by simply removing the first parameter. Thus making

    $taxonomies = get_taxonomies( '', 'objects' );

    And that returns all the taxonomies. Nav menus are also included but I didn't experiment on listing any of them.

  2. Justin Tadlock
    Member
    Plugin Author

    Posted 3 years ago #

    show_tagcloud causes get_taxonomies to return only tag-like taxonomies.

    That is incorrect, assuming you mean non-hierarchical by "tag-like." The show_tagcloud argument would be used upon taxonomy registration for taxonomies that you'd want to do things like grant the ability to list out a taxonomy's terms. Really great way for widgets to determine whether to show the taxonomy.

  3. Ivaylo Draganov
    Member
    Posted 3 years ago #

    Aha, well then pardon me for misunderstanding the show_tagcloud argument. Then I should be passing it when creating new taxonomies. But the codex just states that:

    show_tagcloud
    (boolean) (optional) Whether to show a tag cloud in the admin UI for this taxonomy

    And what if I don't want to have a tag-cloud in the admin UI and still use the widget without hacking? =)

  4. Ivaylo Draganov
    Member
    Posted 3 years ago #

    Ok, turns out that show_tagcloud has no effect on the UI when the taxonomy is hierarchical. So that makes it clear. But not clear enough in the Codex - might just slide in a minor edit.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic