Best Constant to use to check if WordPress is running
I have a program that can run standalone (outside WP) or inside WP. If the program is running 'inside' WP (via a custom template using appropriate enqueue scripts and add_actions), then there is a constant that the program needs to be defined - an email address that the standalone program will use.
If the program is running on a WP site (inside WP), then the program needs to use the WP admin email address (via the get_option( 'admin_email' )
function.
If the program is standalone (on a non-WP site), then there is a different process that is used to set the email address used by the program.
There are many constants defined within wp-config.php
and wp-settings.php
. What is a good constant to use to check if WP is running? For instance, an option is ABSPATH.
I am looking for a 'best practice' of which WP constant to check - and ideally would be a constant that is not likely to be used in a non-WP site (although I understand that this is impossible to guarantee).