Articles of attachment fields to edit

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://codex.wordpress.org/Plugin_API/Filter_Reference/attachment_fields_to_edit and while I seem to be able to ADD a new field (it appears on the dialog form), I cannot […]

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 function pp_external_link_edit( $form_fields, $post ) { $form_fields[‘pp-external-link-title’] = array( ‘label’ => ‘External Link Title’, ‘input’ => ‘text’, ‘value’ => get_post_meta( $post->ID, ‘pp_external_link_title’, true ), ‘helps’ => ‘Link for […]

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’, ‘xf_attachment_fields’, 10, 2 ); function xf_attachment_fields( $fields, $post ) { $meta = get_post_meta($post->ID, ‘meta_link’, true); $fields[‘meta_link’] = array( ‘label’ => ‘More Media Management’, ‘input’ => […]

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 Libray tab? I’ve included a mock-up of what I’d like the media library […]

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 images as theme options. A (very) simple Thickbox Using attachment_fields_to_edit & media_upload_tabs filters I made it look much […]

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 the editor when the user inserts into post (I can’t use the caption for my purposes […]

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 custom meta fields, but using this requires editing each attachment in Media tb. I was wondering if it is possible to expand fields in […]

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 ability to add an anchor with a class around all images in posts.