mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix error missing wp-load.php
Fixing bug which require missing wp-load.php See ultimatemember#7
This commit is contained in:
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
|
||||
$i = 0;
|
||||
$dirname = dirname( __FILE__ );
|
||||
do {
|
||||
$dirname = dirname( $dirname );
|
||||
$wp_config = "{$dirname}/wp-config.php";
|
||||
$wp_load = "{$dirname}/wp-load.php";
|
||||
}
|
||||
while( ++$i < 10 && !file_exists( $wp_load ) );
|
||||
while( !file_exists( $wp_config ) );
|
||||
|
||||
if ( !file_exists( $wp_load ) ) {
|
||||
$dirs = glob( $dirname . '/*' , GLOB_ONLYDIR );
|
||||
|
||||
foreach ( $dirs as $key => $value ) {
|
||||
$wp_load = "{$value}/wp-load.php";
|
||||
if ( file_exists( $wp_load ) ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once( $wp_load );
|
||||
global $ultimatemember;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user