Support

Account

Home Forums ACF PRO Add ACF option field to custom tab in Woocommerce

Unread

Add ACF option field to custom tab in Woocommerce

  • I’ve added custom tabs to my Woocommerce product pages using a function in function.php but would like to pull the title of the tab in from my ACF field on my options page.

    This is what I have so far but it doesn’t seem to work:

    //ADD CUSTOM TABS TO PRODUCT PAGE – PRODUCT DETAILS
    function custom_product_tab_productdetails( $tabs ) {
    $tab_title = get_field(‘product_page_details_tab’, ‘option’);
    $tabs[‘my_custom_tab-details’] = array(
    ‘title’ => $tab_title,
    ‘callback’ => ‘product_details_tab_content’,
    ‘priority’ => 50,
    );
    return $tabs;
    }

    Any help greatly appreciated!

Viewing 1 post (of 1 total)

The topic ‘Add ACF option field to custom tab in Woocommerce’ is closed to new replies.