WordPress.org

Ready to get started?Download WordPress

Forums

Frontend Uploader
[resolved] Howto Fill description? (2 posts)

  1. Break5
    Member
    Posted 1 year ago #

    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/

  2. Break5
    Member
    Posted 1 year ago #

    It's the key post_content for wp attachements

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.