Support » Plugins and Hacks » Custom Upload Dir » [Plugin: Custom Upload Dir] Gravity Forms Compatibility

  • Resolved landwire

    (@landwire)


    Hi there,
    I would like to get this working with posts that get uploaded through gravity forms! At the moment the media files that GF creates are just added to the /uploads folder ingnoring all the settings I have made in CUD. It works fine for posts from the WP backendn though.

    Is there anyway that those two plugins can play together?
    Any help is appreciated,
    Sascha

    http://wordpress.org/extend/plugins/custom-upload-dir/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Has anyone got those 2 plugins to work together? That would just be the bees knees….

    After many hours I got the two to play. It’s a minor hack for now and reapplied at each update in a few minutes. I hope to get it sorted without hack sooner or later…

    Plugin Author ulfben

    (@ulfben)


    When using some other upload method (than the WordPress media library or admin backend), you must provide:

    $_REQUEST['Upload'] or $_REQUEST['html-upload'] (any non-empty value)

    And – if you want to support all of CUDs post-specific placeholders – provide:

    global $post
    global $post_id
    or $_REQUEST['post_id']

    The values are used in that priority.

    And lastly – Custom Upload Dir only applies if your upload function runs the upload_dir-filter.

    Plugin Author ulfben

    (@ulfben)


    The new drag-n-drop uploader of WordPress 3.3 changed all this, as it provides neither of those flags (Upload / html-upload).

    With CUD 3.3 there is no checking for these. Instead the filter only registers to run while media_handle_upload is executing. media_handle_upload is a built-in WordPress function and handles the file upload POST itself, creating the attachment post.

    Thus; when using custom upload methods, make sure they put the files through that function or CUD will have no effect.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Custom Upload Dir] Gravity Forms Compatibility’ is closed to new replies.