Merge pull request #13 from alexander255/wordpress4-compat

Also search for `pg4wp` data files in the WordPress root directory
This commit is contained in:
Kevin Locke
2018-03-17 13:17:52 -06:00
committed by GitHub

View File

@ -25,11 +25,15 @@ define( 'PG4WP_LOG_ERRORS', true);
define( 'PG4WP_INSECURE', false);
// This defines the directory where PG4WP files are loaded from
// 2 places checked : wp-content and wp-content/plugins
// 3 places checked : wp-content, wp-content/plugins and the base directory
if( file_exists( ABSPATH.'/wp-content/pg4wp'))
define( 'PG4WP_ROOT', ABSPATH.'/wp-content/pg4wp');
else
else if( file_exists( ABSPATH.'/wp-content/plugins/pg4wp'))
define( 'PG4WP_ROOT', ABSPATH.'/wp-content/plugins/pg4wp');
else if( file_exists( ABSPATH.'/pg4wp'))
define( 'PG4WP_ROOT', ABSPATH.'/pg4wp');
else
die('PG4WP file directory not found');
// Here happens all the magic
require_once( PG4WP_ROOT.'/core.php');