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 regardless what button opens the uploader for example post “Add media” would not have any use for this option So I am kinda trying to find … Read more

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 … Read more

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 … Read more

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 … Read more

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’ => … Read more

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 … Read more

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? 1 Answer 1 I would recommend that you begin by having a look at a question asked more recently here. The best option would be to create … Read more