Multiple users – only allow them to manage their own terms for custom taxonomy when logged in

Thanks for the AWESOME solution MikeSchinkel 😀 I just did the following updates in the code and it worked like a charm: add_filter(‘list_terms_exclusions’, ‘yoursite_list_terms_exclusions’, 10, 2); function yoursite_list_terms_exclusions( $exclusions ) { $currentScreen = get_current_screen(); if( current_user_can( ‘my_custom_capability_assigned_to_specific_users’ ) && !current_user_can( ‘manage_options’ ) // Show everything to Admin && is_object( $currentScreen ) && $currentScreen->id == ‘edit-<my_taxonomy>’ … Read more

Archive template for taxonomy terms

I want to document this because I just found the answer recently. The problem with having taxonomy is that most developers have the mindset of expecting the taxonomy to be seen inside the post_type url of: http://hostname/post_type/taxonomy_term Instead, you are going to find the url in: http://hostname/taxonomy_slug/taxonomy_term This means that we often may be creating … Read more

Disable Single Post View for Specific Taxonomy on Custom Post Type

I use template_redirect hook for this purpose. I suppose rented in your question is not taxonomy itself, but one term of some taxonomy. function my_page_template_redirect() { if( is_singular( ‘rentals’ ) && has_term(‘rented’, ‘your taxonomy name’) ) { wp_redirect( home_url(), 301 ); exit(); } } add_action( ‘template_redirect’, ‘my_page_template_redirect’ ); Before page rendering, WP checks if CPT … Read more

How to overwrite a specific parameter in a core taxonomy?

Version 4.4 saw the introduction of the register_taxonomy_args filter in register_taxonomy() which you can use to filter the arguments used to register a taxonomy /** * Filter the arguments for registering a taxonomy. * * @since 4.4.0 * * @param array $args Array of arguments for registering a taxonomy. * @param array $object_type Array of … Read more

Sorting custom taxonomy causes menus error

Currently your code is modifying all term queries, both in the front-end and in the back-end. Each navigational menu is registered as a term in the nav_menu taxonomy, so when you visit the backend to work on the menus, those queries have been modified too by your code snippet. For example, I don’t see any … Read more

check if tag exists in wp database

I think you’re looking for term_exists function. Example Code: <?php $term = term_exists(‘tag1’, ‘post_tag’); if ($term !== 0 && $term !== null) { echo “‘tag1’ post_tag exists!”; } else { echo “‘tag1’ post_tag does not exist!”; } ?>

List taxonomy terms as links

My apologies. After some more searching, I found that I could pass the taxonomy as an argument in wp_list_categories. Here is the info via WordPress Codex.

WordPress custom taxonomy description for each post?

sounds like a silly question but are you echo’ing it out? <?php echo term_description($term_id, $taxonomy); ?> otherwise you’ll need to get the current post’s terms (where my_term is your custom taxonomy): $terms = wp_get_post_terms( $post->ID, ‘my_term’ ) then get the description for the first term in ther array: echo term_description($terms[0]->term_id, ‘my_term’); I’ve not tested this … Read more