Support

Account

Home Forums ACF PRO get_field('field')['subfield'] vs get_field('field_subfield') Reply To: get_field('field')['subfield'] vs get_field('field_subfield')

  • Thank you for the explication.

    I’ve also seen that get_field('field')['subfield'] does not work very well when working with an image subfield in a custom block. get_field('field_subfield') works!

    For example:

    $groupA_image =  get_field( 'groupA')['img'];
    $groupA_imgUrl = $groupA_image[ 'sizes' ][ 'large' ];

    vs

    $groupA_image =  get_field( 'groupA_img' );
    $groupA_imgUrl = $groupA_image[ 'sizes' ][ 'large' ];