I have this text input from woocommerce:
woocommerce_wp_text_input( array(
'id' => '_text_announced',
'label' => __( 'Announced(Global)', 'woocommerce' ),
'desc_tip' => 'true',
'description' => __( 'Year and Month it was announced global', 'woocommerce' ),
'type' => 'text',
) );
But I can’t get the value of the ‘label’ at ACF which is ‘Announced(Global)’.
I tried this code:
$field_key = "_text_announced";
$post_id = $post->ID;
$field = get_field_object($field_key, $post_id);
echo $field['label']
but it yielded nothing.
This is a field added to WooCommerce using one of their functions woocommerce_wp_text_input()
. This field is not registered as a field in ACF. You cannot use get_field_object()
in ACF to get a field that is associated with another plugin.