1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Question about wordpress functions.php page

Discussion in 'WordPress' started by tdd1984, Apr 22, 2018.

  1. #1
    Hi I am trying to insert this function below onto the functions.php page. It's for gravity forms from https://docs.gravityforms.com/gform_upload_path/ . The problem is every I need to set the location like this /wp-content/uploads/leads/attachments/4052 where the 4052 is the post ID. However I can never seem to get the postID to echo on the functions page I tried using

    $post = get_post();

    but still did not work?

    add_filter( 'gform_upload_path', 'change_upload_path', 10, 2 );
    function change_upload_path( $path_info, $form_id ) {
       $path_info['path'] = '/home/public_html/yourdomainfolder/new/path/';
       $path_info['url'] = 'http://yourdomainhere.com/new/path/';
       return $path_info;
    }
    PHP:
     
    tdd1984, Apr 22, 2018 IP