Soft Posted March 16, 2023 Share Posted March 16, 2023 Hi, I would like to add Custom Function in my registrar module so I create function like this. (Ref. https://developers.whmcs.com/provisioning-modules/custom-functions/?search=Admin+Alert) /* Custom Registrar Commands Button in Admin Page */ function mymodule_AdminCustomButtonArray() { $buttonarray = array( "My Custom Function" => "myCustomFunction", ); return $buttonarray; } // Custom Function function mymodule_myCustomFunction($params) { $result = "myCustomFunction"; return $result; } I want to show message "myCustomFunction" when click "My Custom Function" button in registrar command section. But it show the message "The changes to the domain were saved successfully" instead. How to return the response message as I want ? Thank you so much in advance for your help. 0 Quote Link to comment Share on other sites More sharing options...
ultrasparc Posted May 10, 2023 Share Posted May 10, 2023 Have you found a solution how to do it? I am also looking for this solution. 0 Quote Link to comment Share on other sites More sharing options...
Prerna Posted September 7, 2023 Share Posted September 7, 2023 Hi If you want to display a custom message when clicking the "My Custom Function" button, you'll need to modify the code to trigger a custom action and display your desired message. Here's how you can achieve that: php Copy code /* Custom Registrar Commands Button in Admin Page */ function mymodule_AdminCustomButtonArray() { $buttonarray = array( "My Custom Function" => "myCustomFunction", ); return $buttonarray; } // Custom Function function mymodule_myCustomFunction($params) { // Your custom action here $message = "Custom action was performed successfully"; // You can use logActivity to log the custom action if needed logActivity("Custom action was performed by admin: " . $message); // Display the custom message return $message; } In this modified code, the mymodule_myCustomFunction function performs a custom action and sets the $message variable with the message you want to display. You can replace "Custom action was performed successfully" with your desired message. If you have any doubts then check: https://codestoresolutions.com/ 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.