----------------------------------------
* CRM-15629: Paypal IPN not working on Wordpress the first time
https://issues.civicrm.org/jira/browse/CRM-15629
Conflicts:
CRM/Core/Permission/WordPress.php
return TRUE;
}
+ // CRM-15629
// During some extern/* calls we don't bootstrap CMS hence
// below constants are not set. In such cases, we don't need to
// check permission, hence directly return TRUE
return TRUE;
}
+ if (!defined( ABSPATH ) || !defined( WPINC ) ) {
+ require_once 'CRM/Utils/System.php';
+ CRM_Utils_System::loadBootStrap();
+ }
+
require_once ABSPATH . WPINC . '/pluggable.php';
// for administrators give them all permissions
if (!$cmsRootPath) {
CRM_Core_Error::fatal("Could not find the install directory for WordPress");
}
-
- require_once $cmsRootPath . DIRECTORY_SEPARATOR . 'wp-load.php';
+ $path = CRM_Core_BAO_Setting::getItem( 'CiviCRM Preferences', 'wpLoadPhp' );
+ if ( ! empty( $path ) ) {
+ require_once $path;
+ } elseif ( file_exists( $cmsRootPath . DIRECTORY_SEPARATOR . 'wp-load.php' ) ) {
+ require_once $cmsRootPath . DIRECTORY_SEPARATOR . 'wp-load.php';
+ } else {
+ CRM_Core_Error::fatal( "Could not find the bootstrap file for WordPress" );
+ }
$wpUserTimezone = get_option('timezone_string');
if ($wpUserTimezone) {
date_default_timezone_set($wpUserTimezone);