Give comes with a few useful PHP Constants for developers. These should be placed in your
wp-config.php file and only if you understand exactly what they do and how they affect your website.
Give’s constants are created to give developers advanced abilities to interact with Give in ways that would be potentially dangerous under normal circumstances. PHP constants are a very powerful feature of PHP, and of WordPress itself. Here’s a few important resources if you want to learn more about constants:
The `GIVE_SLUG` gives you an easy way to change the slug for all your Give single forms and the Archive page. The default is `donations`. So using the example above, the default would change from this:
Please note that this will have no impact on the “Default” permalink style, but on all others it will appear like the above. Also note that after making this change, it’s best to refresh your permalinks to see the change affected.
define( 'GIVE_API_VERSION', 'v1' );
Currently there is only one version of the Give API. But if you have any trouble activating the API normally (see our documentation on that), you can set this global to force the version.
define( 'GIVE_USE_PHP_SESSIONS' , false);
Occasionally you might have trouble with donors viewing their receipts or issues with sessions because your host does not support or handle PHP Sessions very well (or at all) or there is a caching layer that is preventing Give from setting donor session. In this case, it may be useful to disable PHP Sessions with this constant. In this case, all donor session activity is stored in the database temporarily. For most sites, this won’t be any issue. If you have a heavily trafficked site, disabling PHP Sessions may result in very heavy database usage so keep an eye on that.