Skip to content

Commit

Permalink
Also check in the WordPress base directory for the PG4WP files
Browse files Browse the repository at this point in the history
  • Loading branch information
ntninja committed Mar 17, 2018
1 parent 06884bd commit 0607337
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 0607337

Please sign in to comment.