• Resolved kokimo1

    (@kokimo1)


    Hi, this is in regard to this ticket: https://wordpress.org/support/topic/gravity-pdf-not-working-on-wordpress-vip/.

    The person you were helping, Satya, was still getting errors after applying your code fix because there were curly quotation marks in the code example rather than straight quotes. For example:

    return get_stylesheet_directory(). ‘/gravity-pdf/’;

    I ran into the same issue as Satya (still got the errors after putting your code in functions.php), scratched my head for a minute, then decided to replace all instances of and with ' and it worked! It eliminated the errors in the dashboard and I didn’t have to create the folders manually.

    So yeah, your fix 100% works! It was just the dreaded curly quote thing. Thanks for posting that fix, by the way, cuz it totally saved my ass.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Thanks for opening a new topic to provide feedback about using Gravity PDF with WP VIP. Since the other topic is locked, I’m going to repost the full solution with the correct quotations:

    /* Move PDF Working Directory */
    add_filter( 'gfpdf_template_location', function( $directory, $working_folder, $upload_path ) {
    /* Make sure you include the forward slash! */
        return get_stylesheet_directory(). '/gravity-pdf/';
    }, 10, 3 );
    
    /*
    * You must use the gfpdf_template_location filter in conjunction with the gfpdf_template_location_uri filter
    * Both filters should point to the same directory (one is the path and one is the URL)
    */
    add_filter( 'gfpdf_template_location_uri', function( $url, $working_folder, $upload_url ) {
    /* Make sure you include the forward slash! */
        return get_stylesheet_directory_uri() . '/gravity-pdf/';
    }, 10, 3 );
    
    /* Move the tmp directory */
    add_filter( 'gfpdf_tmp_location', function( $location ) {
        return get_temp_dir() . 'gravity-pdf/';
    } );
Viewing 1 replies (of 1 total)
  • The topic ‘Correction for write permissions solution’ is closed to new replies.