WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Advanced File Uploader
[resolved] How to make the uploaded pictures as Attachment to a post created with GF (4 posts)

  1. lestatu2
    Member
    Posted 4 months ago #

    Hi can you help I use gravity forms to create post by users

    I installed your beautiful plugin....now how to insert in current post the images uploaded throught the form?

    Can you help me?

    https://wordpress.org/plugins/gravity-forms-advanced-file-uploader/

  2. ben.moody
    Member
    Plugin Author

    Posted 4 months ago #

    Hi

    All images are added as attachments to any post created by gravity forms.

    You can output a list of them into a post or template with the [get_adv_uploads] shortcode.

    If you need to do anything else with them you will have to grab all the post attachments manually. here is a good example:

    http://www.wpbeginner.com/wp-themes/how-to-get-all-post-attachments-in-wordpress-except-for-featured-image/

    Thanks

    Ben

  3. shahzad333
    Member
    Posted 4 months ago #

    [get_adv_uploads] doesn't work. How it can be use properly?

  4. ben.moody
    Member
    Plugin Author

    Posted 4 months ago #

    Hi

    Just to be sure are you creating a new post with gravity forms?

    [get_adv_uploads] will only work when used in a post that was created using gravity forms.

    E.G.

    files uploaded in form --> post title fields filled out by user in form --> gravity forms creates a new post based on form data --> plugin attaches any files to that new post.

    [get_adv_uploads] shortcode will then get a list of all files attached to that post.

    IF you want to get ALL files that have been uploaded via gravity forms and are not attached to a post. Then i'm afraid the plugin currently does not support that. I have made this plugin for developers so there are lots of hooks and actions at key points...

    You can add some attachment meta data for each file uploaded to mark it as a gravity forms upload by hooking into the action below:

    do_action( 'prso_gform_pluploader_processed_uploads', $wp_attachment_data, $entry, $form );

    This will give you an array of all files uploaded by the plugin and you can just loop them adding a custom meta data tag for each.

    Then to show all you file uploads via th gravity forms you just have to grab all the attachments which have that meta data via a wp_query call.

    Hope this helps

    Ben

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.