PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Using constants for upload paths and ....

  1. I found this filter and implemented it already:
    http://www.gravityhelp.com/documentation/page/Gform_upload_path

    Here is my code::

    add_filter('gform_upload_path', 'change_upload_path', 10, 2);
    function change_upload_path($path_info, $form_id){
        $path_info["path"] = "/wp-content/uploads/";
        $path_info["url"] =  "http://localhost/freshfaces/wp-content/uploads/";
        return $path_info;
    }

    Specifying trailing slashes did not get them into the link. The absolute path is muddy because I'm developing locally on Xampp.

    Wordpress has two constants that I'd like to use to keep things more portable. They are:
    ABSPATH and WP_CONTENT_URL (or WP_SITEURL) with appendages). These are documented at this link: http://wpengineer.com/2382/wordpress-constants-overview/

    I wrote some code so I could see how those constants rendered the data.
    This code:

    $sitePath = ABSPATH;
    $siteContent = WP_CONTENT_URL;
    echo '<p>The site path is: ' . $sitePath . '</p>';
    echo '<p>The wp-content folder is here: ' . $siteContent . '</p>';

    Produced this output:
    The site path is: C:\xampp\htdocs\freshfaces/
    The wp-content folder is here: http://localhost/freshfaces/wp-content

    I tried putting constants into the filter and they didn't work. In fact, I'm having similar problems getting the image to set as featured image, as many others seem to be having.

    The ability to set paths and locations with variables is sort of a WordPress standard. I use it all the time and, for my custom child themes, I declare constants that are used later in functions.php.

    I know how to write my own forms and I'm sure I could make that work but this sort of defeats the purpose of buying a developer license for Gravity Forms so I can economize on my time.

    This is rather urgent and I hope you will provide a use-able answer. I need to have a demo available for Tuesday morning, April 23, 2013.

    Posted 11 years ago on Monday April 22, 2013 | Permalink