Support

Account

Home Forums ACF PRO Image Field not returning URL

Helping

Image Field not returning URL

  • I have added code to my app from acf to create an image field on an option page. I’m saving the return_format as URL but the image id gets returned instead. I have tested also passing the object and pulling the URL, but in that case also the image id is returned as well.

    Any help would be much appreciated.

    This is how I’m retrieving the field:
    is_null( get_field('header_image','option') ) ? false : get_field('header_image','option');

    This is the code for creating the field:

                    array(
                        'key' => 'field_57157d50cef69',
                        'label' => 'Header Image',
                        'name' => 'header_image',
                        'type' => 'image',
                        'instructions' => 'Select the image you want to show in the menu of the mobile app.',
                        'required' => 0,
                        'conditional_logic' => 0,
                        'wrapper' => array(
                            'width' => '',
                            'class' => '',
                            'id' => '',
                        ),
                        'return_format' => 'url',
                        'preview_size' => 'thumbnail',
                        'library' => 'all',
                        'min_width' => '',
                        'min_height' => '',
                        'min_size' => '',
                        'max_width' => '',
                        'max_height' => '',
                        'max_size' => '',
                        'mime_types' => '',
                    ),
  • This usually happens due to a conflict in either a theme or another plugin. It’s been reported before. Have you tried deactivating other plugins or switching themes?

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Image Field not returning URL’ is closed to new replies.