admin管理员组文章数量:1327297
I want to Customize the Yith Plugin for which I want to add some custom fields with Existing fields. I am getting fields from ACF and adding them to an array ACF Fields are showing up in Yith Setting but only a few are showing up in the Homepage and other site pages.
function ta_yith_woo_compare($fields){
$acf_fields_groups = acf_get_fields(5258);
$labels = array();
foreach($acf_fields_groups as $grp)
{
$group_id = $grp['ID'];
$sub_fields = $grp['sub_fields'];
foreach($sub_fields as $fld){
$labels[$fld['name']] = $fld['label'];
}
}
$fields =$fields + $labels;
return $fields;
}
I want to Customize the Yith Plugin for which I want to add some custom fields with Existing fields. I am getting fields from ACF and adding them to an array ACF Fields are showing up in Yith Setting but only a few are showing up in the Homepage and other site pages.
function ta_yith_woo_compare($fields){
$acf_fields_groups = acf_get_fields(5258);
$labels = array();
foreach($acf_fields_groups as $grp)
{
$group_id = $grp['ID'];
$sub_fields = $grp['sub_fields'];
foreach($sub_fields as $fld){
$labels[$fld['name']] = $fld['label'];
}
}
$fields =$fields + $labels;
return $fields;
}
Share
Improve this question
asked Aug 7, 2020 at 6:12
Sheeraz AhmedSheeraz Ahmed
1
1 Answer
Reset to default 0I figure out this by changing the following code from compare.php in Yith Plugin.
<?php foreach ($fields as $field => $name) : ?>
<th>
<?php if ($field != 'image') echo esc_html( $name); ?>
</th>
.
.
.
Changed to this =>
<?php foreach ($fields as $field => $name) : ?>
<th>
<?php if ($field != 'image') echo esc_html( $field ); ?>
</th>
.
.
.
本文标签: pluginsACF Fields are not showing up on Homepage
版权声明:本文标题:plugins - ACF Fields are not showing up on Homepage 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742205578a2432750.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论