Add ‘Description’ to taxonomy ‘Quick Edit’

Normally to add fields to the quick edit field, we should use ‘quick_edit_custom_box’ action hook that is triggered only for custom columns, because core columns are explicitly excluded (see code). If we add a custom column, then it will be shown in the list table, but it doesn’t make sense, because the column description is … Read more

Remove the category/taxonomy description field?

When no hook is available, you can always count on the old jQuery trickery… add_action( ‘admin_footer-edit-tags.php’, ‘wpse_56569_remove_cat_tag_description’ ); function wpse_56569_remove_cat_tag_description(){ global $current_screen; switch ( $current_screen->id ) { case ‘edit-category’: // WE ARE AT /wp-admin/edit-tags.php?taxonomy=category // OR AT /wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=1&post_type=post break; case ‘edit-post_tag’: // WE ARE AT /wp-admin/edit-tags.php?taxonomy=post_tag // OR AT /wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&tag_ID=3&post_type=post break; } ?> <script type=”text/javascript”> … Read more

How to add a default item to a custom taxonomy?

Have a look here: https://web.archive.org/web/20150403012347/http://wordpress.mfields.org/2010/set-default-terms-for-your-custom-taxonomies-in-wordpress-3-0/ Basically what you need to do is use the save_post hook to check the terms for the post and add the default term from your taxonomy if it’s empty. If you just want to have an initial term set in your custom taxonomy, then you can use wp_insert_term(). Probably easiest … Read more

Custom taxonomy list page?

There is nothing built-in to WordPress to provide an “index” page for your taxonomy as your question implies there should be (and I agree, there should be! But there isn’t.) Instead you have to hack it and one way to do that is to create a page called “Main Ingredient” with a main-ingredient URL slug … Read more

Custom columns for taxonomy list table

The manage_{TAXONOMY}_custom_column filter hook passes 3 arguments: $content $column_name $term_id So try this: function add_book_place_column_content($content,$column_name,$term_id){ $term= get_term($term_id, ‘book_place’); switch ($column_name) { case ‘foo’: //do your stuff here with $term or $term_id $content=”test”; break; default: break; } return $content; } add_filter(‘manage_book_place_custom_column’, ‘add_book_place_column_content’,10,3);

How to get taxonomy term of the current page and populate queries in the template

Hm, if you registered a taxonomy for the “page” object type correctly and then assigned a term of that taxonomy to a page… I believe you can then access the taxonomy and term slugs in the following way: get_query_var( ‘taxonomy’ ) get_query_var( ‘term’ ) If you print_r($wp_query) you will see all the parameters that are … Read more