Support » Plugin: Forms: 3rd-Party Integration » Use of hooks – How to implement on new plugin?

  • Resolved klode


    After some time studying the right method to implement hooks on preview plugin (CF7 3rd Party Integration), now I get notice of this new plugin.

    So my problem is this:

    1. I have a form with CF7 with some fields;
    2. I create a new Service with CF7 3-rd Party;
    3. I set as “submission Url” a php file on my plugin folder (*1);
    4. I create a new PHP file with class “Cf73rdParty_NewUserRegistrationCallbacks”;
    5. I want to make some check before sending emails;

    (1*) What this file must to be return as data? And how can I use the Class of the service to make some check before send emails?

    And again…

    For a better information about using hooks, I found a little problem. I use a Class, like mailchimp service and all the other services on third-parties folder of the plugin.

    add_action(‘Cf73rdPartyIntegration_service_a0’, array(&$this, ‘data_registration_execute’), 10, 2);

    This is the action in the __construct method of the class.

    The method:

    public function data_registration_execute($response, $results){…}

    require on your code the using the “&” reference for $results, but I get (in debug mode) this error:

    Warning: Parameter 2 to Cf73rdParty_NewUserRegistrationCallbacks::data_registration_execute() expected to be a reference, value given

    So, the “&” reference is removed. In this mode, this method works fine.

    With the action “Cf73rdPartyIntegration_onfailure”, I can get the “errors” element from the action “Cf73rdPartyIntegration_service_a0”, so I can check which type of error I get.
    But the command:


    it seems to work properly, but it empties all fields on module.

    Does I made something wrong?

    I know, my English is not so good! I hope you can understand my question.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Use of hooks – How to implement on new plugin?’ is closed to new replies.