Questions tagged [attachment-fields-to-edit]

attachment_fields_to_edit is a filter. It is applied to the form fields to be displayed when editing an attachment. Called in the get_attachment_fields_to_edit function. Filter function arguments: an array of form fields, the post object.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

File attachment field plugin for posts

I need to add a field in the posts to add attachments like PDF doc jpg PNG ... and then have it automatically displayed under the post. Do you know of any plugins that already do this, I've tried a ...
LesCa's user avatar
  • 21
0 votes
1 answer
206 views

How to get all attachment image from post ?? WordPress

I just want to get all atachment image from post with Alt, description, title, size, resotution and how to add DOWNLOAD button? i want to create image downloading website on wordpress for example LINK ...
SauRav's user avatar
  • 5
0 votes
2 answers
434 views

Get all image in media Gallery with alt/title?

Is there a way to fetch the ALT/TITLE of ALL images in the media gallery? I think this would be an easy way for a website to have a Pictures page that just pulls all of the images from the media ...
SauRav's user avatar
  • 5
1 vote
0 answers
185 views

Add the description field on the attached media

Well, we want to add the description field on the attached media under the post edit page. I have attached an image for reference. Explanation: Under posts, after adding an attachment if we click on ...
Rajneesh Tiwari's user avatar
1 vote
0 answers
20 views

Customizing the attachement page to show rest of all images in a gallery from post

How to customize the attachment image page with previous and next navigation button and show below rest images in a gallery ? I just added a visual representation Post page Attachment page
Sreerajdesign's user avatar
0 votes
1 answer
298 views

Custom field in media library not saving, selected() function not adding "selected" to select list input type

Following the approach in the developer docs for selected() but can't get it to work with a custom field in the media library for a select list. It won't save the value, or become "selected"....
OneFishTaco's user avatar
0 votes
0 answers
82 views

attachment_fields_to_save first parameter is null

I have the following code in a self-written plugin. In the function saveHomepageGalleryCheckbox the first param ($post) is always null. Did I something wrong? The second parameter ($attachment) has ...
sydev's user avatar
  • 123
1 vote
1 answer
883 views

Post edit - Media Library - Only get images from current post

I've got a few ACF Image fields for posts And I want to only query the images in the media library browser already uploaded and used on the current post. In other words, when opening the media library ...
Tim's user avatar
  • 157
3 votes
0 answers
1k views

Make alt text required when setting a featured image

In the EU it will shortly be a requirement for public sector websites to have alt text for uploaded images. My organisation's users are rubbish at adding alt text, however, and I'm trying to find a ...
JohnG's user avatar
  • 334
0 votes
1 answer
425 views

Save attachment custom fields on front end

I have a front end post form that lets users upload multiple photos and on there I have 2 input fields to try and save custom meta data for each attachment - $vid_pix = get_post_meta($v_Id, 'vid_pix',...
730wavy's user avatar
  • 193
0 votes
0 answers
191 views

Unexpected issue when using attachment_fields_to_edit filter

I am developing my plugin to add a custom attachment fields. I used attachment_fields_to_edit filter (https://codex.wordpress.org/Plugin_API/Filter_Reference/attachment_fields_to_edit) to resolve my ...
gaupoit's user avatar
4 votes
1 answer
3k views

Official documentation for attachment form fields

I'm trying to use the attachment_fields_to_edit hook to create new fields on media attachments. According to the new documentation, one of the parameters is an "array of attachment form fields". I ...
That Brazilian Guy's user avatar
2 votes
1 answer
666 views

Is there a native wp.media way to detect who "opened" wp.media.frame

I added few custom fields via attachment_fields_to_edit and would like to show them only when certain theme or page builder image option opens the wp.media.iframe. Currently they are visible ...
Benn's user avatar
  • 1,023
0 votes
1 answer
347 views

Adding fields to attachment - only shows when inserting new attachments

I'd like to add two custom text fields for image attachments to posts (images inserted into the content of a post). Second I'd also like to remote some of the default fields like caption and ...
Daniel Setréus's user avatar
1 vote
2 answers
225 views

Can't display errors in attachment_fields_to_save

I am writing a plugin for adding a custom field to the image attachment dialogue box, the plugin works for storing valid input data. I have a problem for showing the error message "This is not a valid ...
Infrid's user avatar
  • 111
5 votes
1 answer
411 views

How could I add button next to "edit image" button in "Attachment Details"

How could I add button next to "edit image" button in "Attachment Details" This is the location I would like to add button, Do you have any recommend?
KKND_BLACK's user avatar
2 votes
2 answers
2k views

How to set default value for 'Alt text' on image upload dialog?

I'm using WP 4.1.1 and trying to create a default value for the 'Alt text' when uploading an image (dropping it straight into post and dialog appears). I've tried doing this with this hook https://...
gvanto's user avatar
  • 143
3 votes
2 answers
6k views

Add custom field to media attachment image attribute in post editor

I have the following filter, but do not know how to add custom attributes to image field, when attaching media to post. example <img data-ext-link-title="" data-ext-link-url=""> functions.php ...
madphp's user avatar
  • 97
1 vote
1 answer
333 views

Automatically add image caption with values from a post parent field?

i have a custom dropdown field on post and i would to get the value from that custom field and insert it on each image caption field uploaded to the current post. I have been looking for a way to do ...
christianpv's user avatar
11 votes
2 answers
4k views

Add custom Attachment Display Setting for images

I've been doing a lot of research and I've yet to work this out. Can you add in a custom option in the Attachment Display Settings (part of Insert Media dialog in post editor)? What I'm after is the ...
Gerico's user avatar
  • 277
5 votes
1 answer
312 views

How can I append custom data to images in the editor?

I've added a custom meta field to my image details so that a client can add a number to their photos (a design choice). The data would need to show up under each image (like a caption) inserted into ...
robalan's user avatar
  • 727
0 votes
1 answer
1k views

Custom classes for attachments

I'm trying to create a custom field in ATTACHMENT DETAILS section. I want to add in this field multiply words separated by space which will be than added as a classes to particular images. This is ...
Nikita's user avatar
  • 419
0 votes
1 answer
122 views

Custom attachment field dissapearing

I'm adding a custom attachment field to the media uploader using WordPress' "attachment_fields_to_edit" and "attachment_fields_to_save" filters, which works fine initially after uploading an image (...
Matt Dietsche's user avatar
1 vote
1 answer
175 views

What is the way to add additional fields to attachments in 3.5+?

I used to use attachment_fields_to_edit filter, but it seems that in 3.5+ it has been dropped. What is the new way of adding additional attachment fields? UPDATE: It seems that it wasn't dropped, ...
jayarjo's user avatar
  • 498
0 votes
1 answer
312 views

Adding thumbnails for non-image attachments

I'm working on a site that provides Photoshop resources. I would like to create a page offering brushes for download that displays a thumbnail image and a link to a .zip file for each brush set. I was ...
TWD's user avatar
  • 1
1 vote
0 answers
807 views

$form_fields from attachment_fields_to_edit returning empty array

I'm trying to remove the caption field from non-images attachments' edit page, which should be a simple matter of unset($post['post_excerpt']), but I can't unset a non-existent value... Looking at ...
Dan's user avatar
  • 887
3 votes
1 answer
2k views

Saving Custom Field in Attachment Window in WordPress 3.5

I'm using the code below to add a custom text field in WP 3.5 Attachment Window (from this question # Expanding new Media Uploader in WordPress 3.5) ... add_filter( 'attachment_fields_to_edit', '...
Faisal Khurshid's user avatar
5 votes
2 answers
2k views

Expanding new Media Uploader in WordPress 3.5

In current version of WordPress it is quite easy to expand the attachments fields using attachment_fields_to_edit filter, but in latest WordPress 3.5 RC2 it's not working. We can expand it using ...
rzepak's user avatar
  • 88
1 vote
1 answer
4k views

How can I remove the image attachment ALT field?

I've been using the technique described in this post to remove the caption and description fields in the uploads modal window, thus eliminating unused clutter for users. Since the title field is ...
Sam's user avatar
  • 357
0 votes
1 answer
272 views

Loop issues when creating custom query for media uploader

I'm working on a theme for a magazine publisher who routinely deals with a large number of images. I need them to be able to associate each image with a contributor (photographer, illustrator, artist, ...
Philip Downer's user avatar
3 votes
1 answer
553 views

Looking for a hook to add attachment information to the media library tab

I would like to be able to determine if an image has been attached to a post by looking at the collapsed viewmedia library tab. Is there's a hook I can use to add that data to this view of the Media ...
John-Michael's user avatar
0 votes
1 answer
301 views

How to set order for attachment form field?

I'm adding some fields to attachment edit form by add filter to "attachment_fields_to_edit". The added fields work fine but they are not rendered as the order I added them. Is there a way to order the ...
Jenny's user avatar
  • 1,747
1 vote
1 answer
464 views

Saving attachment custom fields

I want to establish a relationship between individual post attachments and Users. So far I've got my users listing just fine, but it isn't saving/updating. add_filter("attachment_fields_to_edit", "...
thv20's user avatar
  • 153
4 votes
1 answer
1k views

Thickbox hacking - removing fields

Default (big and ugly) Thickbox I don't like how this Thickbox's page looks at all, I almost never use all these settings fields so decided to get rid off them, at least on pages where I'm uploading ...
Wordpressor's user avatar
  • 5,041