Support

Account

Home Forums Backend Issues (wp-admin) Fields not working on Image / Attachments Details

Solving

Fields not working on Image / Attachments Details

  • Hello,

    I’ve been trying to get this working but seems to not function. I am trying to get my Attachment ACF group to appear when editing an already attached image from the “Image Details” Pop-up.

    It is working great everywhere else such as the media library, media uploader and featured image window.

    Any help would be greatly appreciated! I am on the most up to date version of ACF and WP 4.7

    Working:

    On Image Details Modal:

  • Hi @stadl0r

    It seems related to the location rule you have. Could you please share the JSON or XML export file of your field group so I can check the setup you have?

    Also, could you please let me know the detailed steps to reproduce the issue?

    Thanks 🙂

  • Thanks for the reply! To reproduce, you just need to make a new field and assign that field group to “Attachment”. You will see the fields visible on the Add Media uploader, but when in a post, try editing an image and you will not see the fields on the Edit Image details pop-up

    Here is the export code of the field.

    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array (
    	'key' => 'group_57e963afdcfe3',
    	'title' => 'Photo Fields',
    	'fields' => array (
    		array (
    			'default_value' => '',
    			'maxlength' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'key' => 'field_582226ff24d7c',
    			'label' => 'Artist / Photographer',
    			'name' => 'photographer',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'default_value' => '',
    			'placeholder' => '',
    			'key' => 'field_5822270c24d7d',
    			'label' => 'URL for Artist / Photographer\'s Website',
    			'name' => 'photographer_url',
    			'type' => 'url',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    		),
    		array (
    			'default_value' => '',
    			'maxlength' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'key' => 'field_58222aaa2fadb',
    			'label' => 'Licensor / Distributor',
    			'name' => 'license',
    			'type' => 'text',
    			'instructions' => 'Cite the publishing house or source of image (e.g. Getty, Flickr, MOMA...)',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'default_value' => '',
    			'placeholder' => '',
    			'key' => 'field_5822271f24d7e',
    			'label' => 'URL for Image Source',
    			'name' => 'photo_url',
    			'type' => 'url',
    			'instructions' => 'Link to the specific page of the image provided.',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    		),
    		array (
    			'multiple' => 0,
    			'allow_null' => 1,
    			'choices' => array (
    				'None (All Rights Reserved)' => 'None (All Rights Reserved)',
    				'Some Rights Reserved' => 'Some Rights Reserved',
    				'Public Domain Work' => 'Public Domain Work',
    				'Public Domain Dedication (CC0)' => 'Public Domain Dedication (CC0)',
    				'Attribution' => 'Attribution',
    				'Attribution-ShareAlike' => 'Attribution-ShareAlike',
    				'Attribution-NoDerivs' => 'Attribution-NoDerivs',
    				'Attribution-NonCommercial' => 'Attribution-NonCommercial',
    				'Attribution-NonCommercial-Sharealike' => 'Attribution-NonCommercial-Sharealike',
    				'Attribution-NonCommercial-NoDerivs' => 'Attribution-NonCommercial-NoDerivs',
    				'U.S. Government Work' => 'U.S. Government Work',
    				'No known copyright restrictions' => 'No known copyright restrictions',
    			),
    			'default_value' => array (
    			),
    			'ui' => 0,
    			'ajax' => 0,
    			'placeholder' => '',
    			'return_format' => 'value',
    			'key' => 'field_58222acc2fadc',
    			'label' => 'License',
    			'name' => 'image_licenses',
    			'type' => 'select',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    		),
    		array (
    			'taxonomy' => 'image-tag',
    			'field_type' => 'multi_select',
    			'multiple' => 0,
    			'allow_null' => 1,
    			'return_format' => 'id',
    			'add_term' => 1,
    			'load_terms' => 0,
    			'save_terms' => 1,
    			'key' => 'field_58233eaeb75c2',
    			'label' => 'Tags',
    			'name' => 'image_tags',
    			'type' => 'taxonomy',
    			'instructions' => 'Provide rich descriptors to help search.',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'attachment',
    				'operator' => '==',
    				'value' => 'all',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => 1,
    	'description' => '',
    ));
    
    endif;
  • Hi @stadl0r

    Please keep in mind that the image edit menu in the content area is used to modify the selected image. So you can have two same images in the content area with different settings.

    If you want to modify the custom fields for that image, kindly use the media page or use the “Add media” button instead.

    But if you think the custom fields should show up on the image edit menu in the content area, please open a new ticket so your request can be passed directly to the plugin author? You can open a new ticket here: https://support.advancedcustomfields.com/new-ticket. Also, please don’t forget to explain your request again and provide the link to this thread.

    I hope this makes sense 🙂

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

The topic ‘Fields not working on Image / Attachments Details’ is closed to new replies.