Tuesday 15 February 2011

php - How to write wordPress Hook? -


I followed this instruction to write a hook for the form: author from third party integration plugin ()

Each activity is given as a hook in the 'hook' section of each service - # add_action ('Form 3rdPartyIntegration_service_a #', $ response, $ param_ref);

The hook for each service, provides a function that takes $ $, & amp; Results as $ arguments

Allows you to process further on service response, and change the processing results provided in the form of an array ('success'> false,' Errors' => false, 'enclosed' => '', 'message' => '');

Success = True or False - Attach the service request back to the array of messages with error "Error" = Error = = Attach to the end of the email body < / P>

Message = Message Notification (from CF7 AJAX response) is not shown below the form that the basic "success situation" may be enlarged by post processing here

I have come up with this function and it's my functions.php But it does not work. Am I doing something wrong?

  if class_exists ('Cf73rdParty_custom_message')) {class Cf73rdParty_custom_message {public function __construct () {// 2 parameters are required for actions: Third-party response, resulting placeholder /// Note: add_action ('Form3rdPartyIntegration_service_a7', array (and $ this, 'adjust_response'), 10, 2) in your service (in admin settings) Customize this hook name to match:} // - function __Construct universal Nick function adjust UI response ($ response, and $ result) {if (empty ($ response [ 'body'])) {if ($ response [ 'body'] = 'Grahkaksist'); {$ Response ['success'] = 'wrong'; $ Result ['errors]] = array (' user already exists'); $ Result ['message'] = 'A test already exists for this customer'; }}}}} $ Cf73rdParty_custom_message_ins = New Cf73rdParty_custom_message (); // Attached hook  


No comments:

Post a Comment