Articles of uploads

Get attachment ID of author_meta image – Attachment Metadata

I’ve created a custom field in user profile where upload a profile image. It’s very simple. To create fields I’ve used: add_action( ‘show_user_profile’, ‘cover_image_function’ ); add_action( ‘edit_user_profile’, ‘cover_image_function’ ); function cover_image_function( $user ) { <h3>Cover Image</h3> <style type=”text/css”> .fh-profile-upload-options th, .fh-profile-upload-options td, .fh-profile-upload-options input { vertical-align: top; } .user-preview-image { display: block; height: auto; width: […]

What permissions does wp-content/uploads need?

What is the default wp-content/uploads directory permission? What chmod command do I need to set it correctly?

Add metabox with media uploader in a custom post type

This question already has an answer here: Add “upload media” button in meta box field 2 answers

Post type specific upload folder in 3.5

In 3.4 I used the following function to change image upload folder by post type. Different upload directory based on post type in a theme Now it doesn’t work anymore in 3.5. Do you have any idea how to replace this function in 3.5 version? thanks

Need to download uploaded binary file

I have uploaded a binary .war file which is nothing but a .zip file with Java web application extension. When I hit the URL for this file, I see junk characters in browsers. URL: http://www.javaquizmaker.com/QuizGenerator.war Need a way by which I can make the users download this file. By the way, I uploaded using FTP […]

Automatically wrap post image in div

In regards to image attachments inserted into a post, I would like to wrap the img tag inside a div tag for specific design purpose. Is there a way to do this automatically after attaching the image file, like through hooks/filters maybe? Thanks in advanced!!

Prevent renaming of uploaded media

I would like to upload a PDF file with spaces in it, and I want to do this using the uploader in the rich text editor (really, I want other, less savvy people to be able to do it, so convoluted workarounds are not really an option). Trouble is, WordPress (3.0.3) insists on replacing spaces […]

Custom image upload

I’m trying to setup upload for for attachments for my custom post form. At first I add to my form tag enctype=”multipart/form-data” For testing purposes I have two upload forms, but in future I’m gonna implement only one form and use jQuery to append as many forms as I want. <fieldset class=”images”> <label for=”images”>Front of […]

Hook to get image filename when it is uploaded

I want to get the full local filename of an uploaded image so that I can copy it to a new directory and process it with my own image processing scripts. Which hooks/actions should I look into to achieve this? Thanks

Why are two functions over-riding each other?

I have function in my plugin that is: add_filter(‘comment_text’, ‘commentimage_comment_text’); function commentimage_comment_text($comment = ”) { $options = get_option(‘commentimage’); $id = get_comment_ID(); $images = $options[‘images’]; if (!isset($images) || !is_numeric($images)) $images = 1; $url = get_option(‘siteurl’); for ($i=0; $i<$images; $i++) { if (file_exists(ABSPATH . ‘wp-content/comment-image/’ . $id . ($i==0?”:(‘-‘.$i)) . ‘-tn.jpg’)) { $comment .= ‘<p><a href=”‘ . […]