{"id":5100,"date":"2018-01-28T08:33:16","date_gmt":"2018-01-28T13:33:16","guid":{"rendered":"https:\/\/themespress.ca\/?p=5100"},"modified":"2022-10-01T14:42:20","modified_gmt":"2022-10-01T18:42:20","slug":"admin-woocommerce-display-the-id-column-in-the-category-table","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/admin-woocommerce-display-the-id-column-in-the-category-table\/","title":{"rendered":"Admin WooCommerce: Display the ID Column in the Category table"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>In ths tutorial, we will show you how, with two distinct functions, we can display an ID column in WooCommerce Admin with the help of a shortcode.<\/p>\n<p>There exist two WordPress filters: <strong><a href=\"https:\/\/codex.wordpress.org\/Plugin_API\/Filter_Reference\/manage_$taxonomy_id_columns\" target=\"_blank\" rel=\"noopener\">manage_edit-category_columns<\/a><\/strong> and <strong><a href=\"https:\/\/codex.wordpress.org\/Plugin_API\/Filter_Reference\/manage_$taxonomy_id_columns\" target=\"_blank\" rel=\"noopener\">manage_category_custom_column<\/a><\/strong>.<\/p>\n<p>In our example, we are going to use them to display WooCommerce taxonomies.<\/p>\n<p>Let&#8217;s build our first function, <strong>manage_edit-category_columns<\/strong>, by replacing <strong>category<\/strong> with <strong>product_cat<\/strong>.<\/p>\n<p>To edit the WooCommerce taxonomies, we&#8217;ll replace <strong>manage_edit-category_columns<\/strong> with <strong>manage_edit-product_cat_columns<\/strong> and identify it as <strong>termid<\/strong> as our column that we&#8217;ll call with our functions:<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div id=\"ts-enlighterjs-container-2347289\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-2347289\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">function my_custom_taxonomy_columns( $columns )\n{\n\t$columns[&#039;termid&#039;] = __(&#039;Term ID&#039;);\n        return $columns;\n}\nadd_filter(&#039;manage_edit-product_cat_columns&#039; , &#039;my_custom_taxonomy_columns&#039;);<\/pre><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>So with this, we can set up the required column.<\/p>\n<p>The next filter will allow us to display the WooCommerce Taxonomy ID. We&#8217;ll do the exact same thing for <strong>manage_category_custom_column<\/strong>, by replacing it with <strong>manage_product_cat_custom_column<\/strong>.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div id=\"ts-enlighterjs-container-2893700\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-2893700\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">function my_custom_taxonomy_columns_content( $content, $column_name, $term_id )\n{\n    if ( &#039;termid&#039; == $column_name ) {\n        $content = $term_id;\n    }\n    return $content;\n}\nadd_filter( &#039;manage_product_cat_custom_column&#039;, &#039;my_custom_taxonomy_columns_content&#039;, 10, 3 );<\/pre><\/div><\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"In ths tutorial, we will show you how, with two distinct functions, we can display an ID column in WooCommerce Admin with the help of a shortcode. There exist two<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/admin-woocommerce-display-the-id-column-in-the-category-table\/\">Read More<\/a><\/div>","protected":false},"author":81,"featured_media":5103,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[328],"class_list":["post-5100","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-woocommerce-config"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=5100"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5100\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/5103"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=5100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=5100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=5100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}