Okay I think I have it, you need to add a matching filter to attachment_fields_to_save
to save the new field (say as post meta to the attachment.)
add_filter( 'attachment_fields_to_save', 'save_some_custom_field', 10, 2 );
function save_some_custom_field($post, $attachment) {
$attachid = $post['ID']; // yes this is actually an array here
update_post_meta($attachid,'someCustom',$attachment['someCustom']);
}
Then you would add to your $form_fields
edit filter array something like:
'value' => get_post_meta($post->ID,'someCustom',true),
…remembering to remove the = null
from the function arguments.
unset($form_fields['post_excerpt']);
and unset($form_fields['post_content']);
in the edit filter should remove caption and description fields respectively, not sure on the required part though.
Related Posts:
- Saving Custom Field in Attachment Window in WordPress 3.5
- Custom field in media library not saving, selected() function not adding “selected” to select list input type
- Change behavior of “Insert into Post” based on attachment metadata
- How can I append custom data to images in the editor?
- Add new “Insert Into Post” button with another function
- How to save custom fields for attachments
- Save attachment custom fields on front end
- How to save media files under custom folder without changing wp-config.php or changing media settings
- How to add upload video option in wordpress for user?
- Can’t display errors in attachment_fields_to_save
- Custom dropdown field added to media gallery; how to get it to save properly?
- $form_fields from attachment_fields_to_edit returning empty array
- 3.8 Media Upload and Custom Meta Box
- How can I create more “create attachment” custom field – any idea?
- Custom classes for attachments
- Adding thumbnails for non-image attachments
- Insert wp gallery shortcode into custom textarea
- Media Custom Fields – get a value with PHP
- Save Custom Meta Value on Media Upload
- Where are custom field values stored in the database
- Using TinyMce with textareas in meta boxes on custom post types
- How can I fetch CSS from JSON WP REST API response
- How to set a default meta value for custom field
- Create meta boxes that don’t show in custom fields
- How To Create a Metabox of HTML Content with Instructions For Editors When Editing a Post or Page?
- wp_editor in add_meta_boxes does not show gallery
- Calling Specific Pages with wp query Part II
- How do I assign this filter to a variable? (Appending php & markup to the_content)
- If value present, order posts by two consecutive custom fields
- Copying Custom Meta Values from existing post to a duplicate post
- Deleting a custom field field
- custom field to always to .get_the_title()?
- Displaying posts with only upcoming dates according their custom field date value
- How to filter a dd/mm/yyyy date from a custom field in a query
- Get a post_id where meta_value equals something in a serialized meta_value field
- List posts with common custom field value
- Importing users to Buddypress with custom fields
- Is it bad to use a lot of Custom Meta Fields?
- How to get customfield value by woocommerce product ID
- How do I get the url slug inside the dashboard for a custom post type?
- Audio player shortcode not showing up when using variable
- Custom Fields – Taller editing area
- how to upload a image from frontend with wp_insert_post and also update_post_meta?
- Get updated meta value after post update or published (custom post type) using hook
- custom-meta-box checkboxes from loop won’t save
- Insert a custom field into a shortcode and use it in post(s)
- Uploading PDF using Media Uploader
- Why orderbyb meta_value_num won’t affect the generated SQL Query order?
- Correct syntax for retrieving custom field in CPT
- $TBA Getting Translated to $0 (Custom Fields)
- How Do I Display A Custom Field In The Sidebar Of All My Pages?
- Query_posts with custom field meta value
- Custom Field – Do Not Show if Value is Empty?
- Move Title and the Content WYSIWYG editor position
- Displaying Meta-Box Data Properly
- wp custom field date format compare
- frontend submit post jQuery clone row won’t save
- WordPress colorpicker save both hex and RGB
- Can’t get video meta from wp_read_video_metadata()
- Include one custom field in search results
- Custom search SQL Query to add custom field in result
- Can wp_insert_post_data filter be used to save custom field data?
- Meta query relation ‘OR’ not working as expected
- using advanced custom field to control css hover color
- Custom Field data only shows after manual post update
- Custom field Search with Relavanssi
- How to exclude custom fields from search queries?
- Add Custom Fields After Page Title
- Footnotes in custom fields
- Image upload and path to custom field
- How to show content of custom fields in search results?
- simple fields plugin custom query
- Set class if a meta value is set within post archive
- Using Customizer API vs Custom Meta Box for custom content
- Filtering posts by ACF meta query
- checking liked user in wordpress rest api
- Custom meta boxes – add php code inside?
- How to use a custom field with add_rewrite_rule()?
- User custom meta delete by serialised key value
- Metabox value for post loop?
- Get file size from ACF repeater field
- Append custom field items to content from plugin
- Text in header as a page – hide from Web crawlers
- When post is updated, custom metadata in text area field is overwritten
- Set Value To Custom Field While Submit
- Custom Field: Display only if a specific key is selected outside the loop
- Show or hide lang=”ur” in main element
- How to use a custom field for search engine optimization
- Fetch data from a WP page with same name as current username
- Getting content from custom fields of different pages on a single page
- Custom Fields – How can I remove the publish option for certain users
- When editing a post with a custom meta box the values aren’t displaying correctly
- Function to retrieve a picture if there is no picture is attached
- How to get the value of particular get $meta value in wordpress
- custom field as a boolean with a checkbox?
- Hiding custom fields when content is empty [closed]
- Website that sells statistics
- Extract array from custom field
- Multiple triggers when publishing, saving or updating a post in WordPress
- If possible a field ID transfom in a Custom Field?