Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also search for pg4wp data files in the WordPress root directory #13

Merged
merged 1 commit into from
Mar 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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