I am developing a small module that would create an additional FTP user with a directory dedicated this user.For the creation of the module, everything is fine.By cons, for hooks, I'm sure of nothing!I activated the addon after the creation of my hooks.php.I would like to know if I do the right thing.Here is the code:
add_hook('AddonActivated', 1, function($vars) {
//Get Product/Service information to get domain and relid
1- Is this the correct hook to create my FTP when activating the addon? 2- Would there be a way to see what my print_r return? 3- What would be the best way to register the associated customs fields?
For more information, my addon is used to create an FTP user with a directory of his own to be able to deposit certain document without having access to anything else.
Question
DeuxK
Hi,
I am developing a small module that would create an additional FTP user with a directory dedicated this user. For the creation of the module, everything is fine. By cons, for hooks, I'm sure of nothing! I activated the addon after the creation of my hooks.php. I would like to know if I do the right thing. Here is the code:
add_hook('AddonActivated', 1, function($vars) {
//Get Product/Service information to get domain and relid
$command = 'GetClientsProducts';
$postData = array(
'serviceid' => $vars['serviceid'],
'stats' => true,
);
$service = localAPI($command, $postData);
print_r($service);
//create FTP user (is OK this part)
//Save to custom fields associate to the addon
});
1- Is this the correct hook to create my FTP when activating the addon?
2- Would there be a way to see what my print_r return?
3- What would be the best way to register the associated customs fields?
For more information, my addon is used to create an FTP user with a directory of his own to be able to deposit certain document without having access to anything else.
Thanks
Link to comment
Share on other sites
0 answers to this question
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.