• Resolved Break5

    (@break5)


    Hi is there any way to write form data in the description field of the generated media library item similar to you given example of

    <?php
    add_action( 'fu_after_upload', 'my_fu_after_upload' );
    
    function my_fu_after_upload( $attachment_ids ) {
        // do something with freshly uploaded files
        // This happens on POST request, so $_POST will also be available for you
        foreach( $attachment_ids as $att_id ) {
    		// Format the title
        	$author = 'By ' . $_POST['name'];
        	$author .= ' ' . $_POST['email'];
        	// Sanitize input from user
        	$author = sanitize_text_field( $author );
        	wp_update_post( array( 'ID' => $att_id, 'post_title' => $author ) );
        }
    }

    http://wordpress.org/extend/plugins/frontend-uploader/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Howto Fill description?’ is closed to new replies.