Wordpress/Woocommerce 如何自定义 wc_display_item_meta [英] Wordpress/Woocommerce how to customize wc_display_item_meta

查看:22
本文介绍了Wordpress/Woocommerce 如何自定义 wc_display_item_meta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些在 unordered-list 中呈现的自定义元值,这很好,但我想知道是否可以自定义输出?

I have some custom meta values which gets rendered in an unordered-list which is fine but I would like to know if it is possible to customize the output?

正如前面提到的 wc_display_item_meta 显示:

As mentioned wc_display_item_meta displays:

<ul class="wc-item-meta">
  <li>
     <strong class="wc-item-meta-label">My label</strong> 
     <p>My custom data</p>
  </li>
</ul>

那么,有可能改变吗?

推荐答案

您可以将参数传递给 wc_display_item_meta() 函数,该函数允许您自定义标记的各个部分.这些是默认值,但您可以将它们更改为您需要的任何值.

You can pass arguments to the wc_display_item_meta() function that allow you to customize parts of the markup. These are the default values but you can change them to whatever you need.

wc_display_item_meta($item, array(
    'before'    => '<ul class="wc-item-meta"><li>',
    'after'     => '</li></ul>',
    'separator' => '</li><li>',
));

这篇关于Wordpress/Woocommerce 如何自定义 wc_display_item_meta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆