Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
Today we’ve officially released the 3.7 update of Gravity PDF. You will be prompted to automatically upgrade over the next 24 hours, or you may download directly from our WordPress Repo.

There were only small tweaks to the software during the beta period however we did include filters to change the PDF configuration folder location entirely.

Change PDF Config Locale

If you want to place the PDF_EXTENDED_TEMPLATES directory in an alternate location you can use the gfpdfe_template_location and gfpdfe_template_location_uri filters to do so. To ensure the software continues functioning you must implement both filters correctly. The example below (which you would put in your active theme’s functions.php file) shows you how to configure the software to look for the folder in the WordPress root directory, however you can store it anywhere.

/*
 * Change the PDF Template Location 
 */
add_filter('gfpdfe_template_location', 'gfpdfe_change_pdf_location', 10, 3);

function gfpdfe_change_pdf_location($path, $basedir, $basefolder)
{
	/* set to base WP directory */
	return ABSPATH . $basefolder . '/'; /* the trailing slash is important! */
}

add_filter('gfpdfe_template_location_uri', 'gfpdfe_change_pdf_location_uri', 10, 3);

function gfpdfe_change_pdf_location_uri($url, $baseurl, $basefolder)
{
	/* set to base WP URI */
	return site_url('/') . $basefolder . '/'; /* the trailing slash is important! */
}

Changelog

The changes between the beta and production releases only included:

  • Feature – Added hooks ‘gfpdfe_template_location‘ and ‘gfpdfe_template_location_uri‘ to change PDF template location
  • Housekeeping – Updated configuration.php examples to include new default config option and refined the copy

For the 3.7 beta changelog see our beta announcement article which goes into greater details about what’s changed in this release.

Published by Jake Jackson

Jake Jackson is the head developer at Gravity PDF. Along with developing the plugin, he uses his expertise to provide support and technical information to Gravity PDF users.

Signup for the latest Gravity PDF news, tips and updates

  • This field is for validation purposes and should be left unchanged.
Scroll To Top

Choose your currency:

Close
Converted prices are for reference only - all orders are charged in $ Australian Dollars ($) AUD.
  • AUDAustralian Dollars ($)
  • USDUS Dollars ($)
  • CADCanadian Dollars ($)
  • EUREuros (€)
  • GBPPound Sterling (£)
  • NZDNew Zealand Dollar ($)
  • JPYJapanese Yen (¥)