wp_update_nav_menu_item() to insert categories

After using the Chrome inspector on the “Appearance > Menus” categories panel I was able to sniff out the hidden form values that are passed when one manually adds a category to a custom menu via the wizard: <li> <label class=”menu-item-title”> <input type=”checkbox” class=”menu-item-checkbox” name=”menu-item[-11][menu-item-object-id]” value=”181″> Category One</label> <input type=”hidden” class=”menu-item-db-id” name=”menu-item[-11][menu-item-db-id]” value=”0″> <input type=”hidden” … Read more

How are terms connected with posts in database?

The posts are related to taxonomies (taxonomy/tag) in the wp_3_term_relationships table, where the object_id column is the post’s id, and the term_taxonomy_id is the taxonomy/tag id. Depending on what you want to accomplish, the solution might be to create the same taxonomies at each blog. This way the tax_query should work as normal.

How to list all categories and tags in a page?

TERM METADATA It’s possible to get thumbnails for terms using the new Term Metadata in 4.4. You just also need to define those ahead of time yourself. add_term_meta( int $term_id, string $meta_key, mixed $meta_value, bool $unique = false ) get_term_meta( int $term_id, string $key = ”, bool $single = false ) update_term_meta( int $term_id, string … Read more

List Hierarchical Term List with Count with Related Term

I’ve done something like this in the Query Multiple Taxonomies plugin: https://github.com/scribu/wp-query-multiple-taxonomies/blob/master/core.php The good news is that it’s a generic solution: it works for any combination of posts and taxonomies. The bad news is that it might take some effort to figure out how it’s done.

Modify Term Update Redirection

I agree with you, it’s somewhat an unexpected user experience, when you’re redirected after updating a term. Additionally there seems to be no error handling on the form itself, if you try to make some errors, like deleting the term name and slug, it will not show any errors, just ignore your changes and redirect. … Read more