Skip to content

Commit

Permalink
Merge pull request #13 from alexander255/wordpress4-compat
Browse files Browse the repository at this point in the history
Also search for `pg4wp` data files in the WordPress root directory
  • Loading branch information
kevinoid authored Mar 17, 2018
2 parents 06884bd + 0607337 commit 3fa4370
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pg4wp/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@
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');
Expand Down

0 comments on commit 3fa4370

Please sign in to comment.