Support

Account

Home Forums General Issues acf field hooking up with woocommerce hooks

Unread

acf field hooking up with woocommerce hooks

  • im trying to display acf field in woocommerce product data > genreal tab
    woocommerce product data

    add_action('woocommerce_product_options_general_product_data', 'add_custom_file_upload');
    function add_custom_file_upload() {
    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array (
        'key' => 'group_12uyy',
        'title' => 'My Group 123',
        'fields' => array (
            array (
                'key' => 'field_1',
                'label' => 'Sub Title light',
                'name' => 'sub_title_light',
                'type' => 'file',
                'prefix' => '',
                'instructions' => '',
                'required' => 0,
                'conditional_logic' => 0,
                'wrapper' => array (
                    'width' => '',
                    'class' => '',
                    'id' => '',
                ),
                'default_value' => '',
                'placeholder' => '',
                'prepend' => '',
                'append' => '',
                'maxlength' => '',
                'readonly' => 0,
                'disabled' => 0,
            )
        ),
        'location' => array (
            array (
                array (
                    'param' => 'post_type',
                    'operator' => '==',
                    'value' => 'product',
                ),
            ),
        ),
        'menu_order' => 0,
        'position' => 'normal',
        'style' => 'default',
        'label_placement' => 'top',
        'instruction_placement' => 'label',
        'hide_on_screen' => '',
    ));
    
    endif;
    }

    im trying to hook acf field-> file type with woocommerce_product_options_general_product_data but im unable to display acf field type in woocommerce hook.

    acf field is not displayed in product data -> general tab

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.