• I’m trying to get WordPress to run in Bootstrap mode with the following require_once function:

    require_once('/full/path/to/the/wordpress/folder/wp-blog-header.php');

    I’ve tried to include other scripts like the wp-config.php file but they all redirect me to /wp-admin/install.php, which displays a ‘Already Installed’ message. The site and admin are running perfectly fine.

    I’m using WordPress version 3.0.3

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dallasclark

    (@dallasclark)

    RESOLVED

    Bootstrap mode doesn’t liked to be called within a PHP5 Class

    Hi, i have the same problem, im using a simple application i wrote in OOP and i need to create users to wp via wp_create_user (to syncronize my app users with wp).

    Did you find a solution?

    Thread Starter dallasclark

    (@dallasclark)

    require_once('../wp-blog-header.php');
    require('../wp-includes/registration.php');
    
    $random_password = wp_generate_password( 12, false );
    	$user_details =	array(
    		'ID' =>	'',
    		'user_pass' => $random_password,
    		'user_login' => $ccustemail,
    		'user_email' => $ccustemail,
    		'first_name' => $ccustfirstname,
    		'last_name' => $ccustlastname,
    		'user_registered' => $ctranstime,
    		'role' => 'subscriber'
    	);
    $user_id = wp_insert_user($user_details);
    Thread Starter dallasclark

    (@dallasclark)

    The wp_insert_user() function is used within the PHP5 Class, the require files are above the PHP5 class

    My code looks like the one you posted, but is within my php class and after the first include i got redirected to ./wp-admin/install.php

    I was wondering if you found out a solution to do that inside a class..

    I can not require wp bootstrap before initialize my class, becose some plugin my customer is using interfere to some path I use returning 404.

    After some research, i found this other way:

    [inside my class]
    public function do_something_wp($data)
    {
        include(MYWP_PATH . 'wp-settings.php');
        $wp->initialize();
        wp_insert_user($data['user'], $data['passwd'], $data['email']);
    }

    but i get the same result of the previous bootstrap.

    I wonder why this happens just while using a class…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Bootstrap Not Working’ is closed to new replies.