hansdesjarlais Posted December 2, 2019 Share Posted December 2, 2019 Hello, I am brand new to WHMCS and looking for some advice, so please forgive my ignorance. I have developed a custom WordPress auto-installer plugin for cPanel. I want to create a hook which will automatically install WordPress using my cPanel plugin upon successful account creation. From what I have read two hooks have been suggested but I want to make sure I'm using the correct one, they are: ClientAdd and AfterModuleCreate. Which one should I use? Also, what is the best/recommend method for me to pass variables from WHMCS to my cPanel plugin to run the install? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 3, 2019 Share Posted December 3, 2019 18 hours ago, hansdesjarlais said: I have developed a custom WordPress auto-installer plugin for cPanel. it might be helpful for you to take a look at the free WHMCS Softaculous addon which can also be used to install WordPress - the addon code isn't encrypted, so it should be useful for you to examine. 18 hours ago, hansdesjarlais said: From what I have read two hooks have been suggested but I want to make sure I'm using the correct one, they are: ClientAdd and AfterModuleCreate. it shouldn't be ClientAdd as that just adds a client to the WHMCS database, but the user should already have an account in WHMCS, or will automatically after ordering, so adding them should be unnecessary... the Softaculous addon uses AfterModuleCreate which should be a clue as to which one to use! 🙂 0 Quote Link to comment Share on other sites More sharing options...
hansdesjarlais Posted December 3, 2019 Author Share Posted December 3, 2019 Hi Brian, Thanks for your response. I managed to figure it out, I used AfterModuleCreate. 0 Quote Link to comment Share on other sites More sharing options...
hansdesjarlais Posted December 3, 2019 Author Share Posted December 3, 2019 @brian! is this the correct way to get the parameters as variables from the AfterModuleCreate hook? // Variables $hostname = $vars['params']['serverhostname']; $username = $vars['params']['username']; $password = $vars['params']['password']; $wp_admin_username = $vars['customfields']['Wordpress Admin Username']; $wp_admin_password = $vars['customfields']['Wordpress Admin Password']; 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.