在woocommerce属性中添加自定义字段

时间:2022-01-22 08:17:32

Does anybody knows what hooks I need to look at if I want to add additional field into woocommerce new attributes page?

如果我想在woocommerce新属性页面中添加额外的字段,是否有人知道我需要查看哪些钩子?

I have slug, but I'd like to add icon field where you'll be able to add icon name, and that will be outputted next to the attribute? And that input field should be below the slug input.

我有slug,但我想添加图标字段,你可以在其中添加图标名称,这将在属性旁边输出?并且输入字段应低于段塞输入。

I found the woocommerce_attribute_taxonomies function, but I'm not sure how to edit it properly without changing the plugin directly.

我找到了woocommerce_attribute_taxonomies函数,但我不确定如何在不直接更改插件的情况下正确编辑它。

1 个解决方案

#1


1  

After looking at woo's webhooks I couldn't find anything that would help. But I did notice that when editing the attribute I wished to add a field to there was this in the url: /wp-admin/edit-tags.php?taxonomy=pa_brand&post_type=product. Every time an attribute is created Woo creates this as a custom tax. This means you can use this tax to create custom metaboxes.

在看了woo的webhooks后,我找不到任何有用的东西。但我确实注意到,在编辑属性时我希望在其中添加一个字段:url:/wp-admin/edit-tags.php?taxonomy=pa_brand&post_type=product。每次创建属性时,Woo都会将其创建为自定义税。这意味着您可以使用此税来创建自定义元变量。

Either by using this tutorial https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/ or a dev toolkit such as CMB2 : https://github.com/WebDevStudios/CMB2

要么使用本教程https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/,要么使用开发工具包,例如CMB2:https://github.com/WebDevStudios/CMB2

Hope this helps someone!

希望这有助于某人!

#1


1  

After looking at woo's webhooks I couldn't find anything that would help. But I did notice that when editing the attribute I wished to add a field to there was this in the url: /wp-admin/edit-tags.php?taxonomy=pa_brand&post_type=product. Every time an attribute is created Woo creates this as a custom tax. This means you can use this tax to create custom metaboxes.

在看了woo的webhooks后,我找不到任何有用的东西。但我确实注意到,在编辑属性时我希望在其中添加一个字段:url:/wp-admin/edit-tags.php?taxonomy=pa_brand&post_type=product。每次创建属性时,Woo都会将其创建为自定义税。这意味着您可以使用此税来创建自定义元变量。

Either by using this tutorial https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/ or a dev toolkit such as CMB2 : https://github.com/WebDevStudios/CMB2

要么使用本教程https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/,要么使用开发工具包,例如CMB2:https://github.com/WebDevStudios/CMB2

Hope this helps someone!

希望这有助于某人!

相关文章