Filter media upload attachment meta
You have to use add_attachment action. I had a similar problem and I recently found your plugin: http://wordpress.org/extend/plugins/format-media-titles/ 🙂
You have to use add_attachment action. I had a similar problem and I recently found your plugin: http://wordpress.org/extend/plugins/format-media-titles/ 🙂
When i needed to do something similar i used the admin_print_scripts-media-upload-popup hook to add my own js/Jquery code to insert a button and handled it’s click event with ajax. something like this: add_action(‘admin_print_scripts-media-upload-popup’,’add_my_media_button’); function add_my_media_button(){ ?> <script> jQuery(document).ready(function() { //loop over all attachments jQuery(“.savesend”).each(function(i,v){ if (jQuery(this).next().attr(‘id’) != “”){ //get attachment id var att_id = jQuery(this).next().attr(‘id’); … Read more
You have to echo the full Audio Tag and insert the custom field MP3 address in it. <?php if ( get_post_meta($post->ID, ‘ses’, true) ) { echo ‘<audio controls=”controls”> <source src=”‘ . get_post_meta($post->ID, ‘ses’, true) . ‘” /> </audio>’; } ?>
If the images are attached to posts, when you export/import your WP data, there’s a happy checkbox for pulling in the images. If you just copied over the DB and all, just FTP the images over and they’re fine.
Media are just posts – so just query posts. This is untested: $args = array( ‘author’ => $author_id, ‘post_type’ => ‘attachment’, ); $query = new WP_Query( $args ); I’m not sure if you want currently logged in user or the author of the post currently in the loop – either way you can set $author_id … Read more
The solution was to simply wrap my JQuery in a function like this: $(‘#wpcontent’).ajaxStop(function() { $(‘.attachment-filters’).change(function(){ if($(this).val() === ‘uploaded’){ alert(“Uploaded images selected”); } else { alert(“Other option selected”); } }); });
if I post today, it lists it as April 30th, 2013 (today is April 6th, 2013). Your using a lowercase t in your date format string. t Number of days in the given month 28 through 31 On Line 92: echo get_the_time(‘M-t-y \a\t g:ha’ , $id); I think you meant to use d or j … Read more
The pdf is itself an attachment post so in wordpress template hierarchy we can create a template named pdf.php Then you can write following code in it which force download the pdf file. <?php if (have_posts()) : the_post(); $pdf_title = $post->post_title; $pdf_src = get_attached_file($post->ID ); $bytes = filesize( $pdf_src ); header(“Pragma: public”); // required header(“Expires: … Read more
$is = get_children(“post_parent=$id&post_type=attachment&post_mime_type=image”); foreach($is as $i) { $url = wp_get_attachment_image_src($i->ID, ‘full’); $caption = $i->post_title); } $id is the id of your post. See http://codex.wordpress.org/Function_Reference/get_children
Try adding this CSS: .wp-video-shortcode { max-width: 100%; } .wp-audio-shortcode { max-width: 100%; }