0

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;
}

1 Answer 1

0

I 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>
.
.
.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.