Jump to content

wordpress codex


Recommended Posts

Hey There,


I'm trying to build a whmcs loginshare with wordpress but hitting a snag,


I built a action hook in whmcs using the wordpress codex functions and on their own outside whmcs they work just fine but within whmcs it keeps on trying to run the wordpress installation as if wordpress is not installed, Here's my code.



function hook_wordpress_account($vars) {

	$userdata = get_userdatabylogin( $vars['email'] );

	$user = array ();

	if ($userdata->ID) {
		$user['ID'] = $userdata->ID;

	$user['user_pass'] = md5($vars['email']);
$user['user_login'] = $vars['email'];
$user['user_nicename'] = $vars['firstname'];
$user['user_email']   = $vars['email'];
$user['display_name'] = "{$vars['firstname']} {$vars['lastname']}";
$user['first_name'] = $vars['firstname'];
$user['last_name'] = $vars['lastname'];

 if (wp_insert_user ($user)) {
 	return true;
 } else {
 	return false;


function hook_login_wordpress_user($vars) {



function hook_logout_wordpress_user($vars) {





Now when I force wordpress to know it its installed by setting the WP_INSTALLING to true or false I get the following error


define( 'WP_INSTALLING', false);



Notice: Undefined variable: PHP_SELF in blog/wp-includes/vars.php on line 36


Fatal error: Call to a member function register_handler() on a non-object in blog/wp-includes/media.php on line 1301


Any help ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated