1

I'm developing a Wordpress site that will let (registered) users upload an image and description to a gallery, but am not sure the best way to do so.

I do not want them to do it through the back end of the site, but rather a "Your Projects" page on the site with a form. The form will have a few text fields and the file upload area.

I was thinking of trying to adapt Contact Form 7 to handle this, but not sure if it's even possible.

Are there any plugins out there that would do this? Thanks

2

2 Answers 2

1

Your best bet is to create a custom plugin to do it with something like:

$wp_filetype = wp_check_filetype(basename($filename), null );
$attachment = array(
   'post_mime_type' => $wp_filetype['type'],
   'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
   'post_content' => '',
   'post_status' => 'inherit'
);
$attach_id = wp_insert_attachment( $attachment, $filename, 37 );
// you must first include the image.php file
// for the function wp_generate_attachment_metadata() to work
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );
wp_update_attachment_metadata( $attach_id,  $attach_data );
1

I found this plugin that does pretty much exactly what I want - plus you can vote for each image. Customization is pretty good, and if you mess around in the code you can do more. Hope this helps anyone else looking for this functionality.

http://wordpress.org/extend/plugins/photosmash-galleries/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.