WooCommerce-将列添加到Product Cat管理表 [英] WooCommerce - add column to Product Cat admin table
本文介绍了WooCommerce-将列添加到Product Cat管理表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在后端表中为产品类别添加一个新列。此列将包含一个链接视图类别,并将所有链接都链接到www.domain.com/category/category-name页面。
I would like to add a new column in the back-end table for Product Categories. This column will contain a link "view category" and will link all to the www.domain.com/category/category-name page.
我调查了Wordpress文档这是我想出的代码...但是它不起作用!
I looked into the Wordpress docs and this is the code I came up with... but it doesn't work!
function product_cat_cpt_columns($columns) {
$new_columns = array(
'Link' => "Link to page"
);
return array_merge($columns, $new_columns);
}
add_filter('manage_product_cat_posts_custom_columns' , 'product_cat_cpt_columns');
有人知道我会怎么做吗?非常感谢您的帮助!
Any idea how I would do this? I really appreciate your help!
推荐答案
从此答案,您可以使用以下代码将列添加到编辑标签屏幕:
Pulling from this answer you can add columns to the Edit Tags screen with the following code:
function add_post_tag_columns($columns){
$columns['foo'] = 'Foo';
return $columns;
}
add_filter('manage_edit-product_cat_columns', 'add_post_tag_columns');
function add_post_tag_column_content($content){
$content .= 'Bar';
return $content;
}
add_filter('manage_product_cat_custom_column', 'add_post_tag_column_content');
这篇关于WooCommerce-将列添加到Product Cat管理表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文