WordPress.org

Support

Support » Plugins and Hacks » [Resolved] How to make the uploaded pictures as Attachment to a post created with GF

[Resolved] How to make the uploaded pictures as Attachment to a post created with GF

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ben.moody
    Member

    @benmoody

    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:

    How to Get All Post Attachments in WordPress Except for Featured Image

    Thanks

    Ben

    shahzad333
    Member

    @shahzad333

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

    Plugin Author ben.moody
    Member

    @benmoody

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] How to make the uploaded pictures as Attachment to a post created with GF’ is closed to new replies.