• Hello,
    I would like to show the checkbox & label as first element in the form. In your template I found the hook:
    add_action( 'yikes-mailchimp-additional-form-fields', array( $this, 'render_frontend_compliance_checkbox' ), 10, 1 );
    I think I need to disable this hook and hook the function

    render_frontend_compliance_checkbox

    to

    do_action( ‘yikes-mailchimp-before-form’, $form_id, $form_data );

    instead, right?
    However, I dont know how to do this because this

    array( $this,

    makes things complicated for me ??
    Could you please help?
    Thank you! ??

Viewing 1 replies (of 1 total)
  • Plugin Contributor jpowersdev

    (@jpowersdev)

    Hi @lenaka,

    When you see array($this, 'function_name') as the callback, it means you are referring to a function defined in the current class. If you are trying to use a globally defined function instead of one that is part of a class, just replace the array with a string – 'function_name'.

    You can define your own custom function in your functions.php file and then use add_action to call it.

    
    function my_custom_function($form_data){
      // do stuff here
    };
    
    add_action('yikes-mailchimp-additional-form-fields', 'my_custom_function', 10, 1);
    

    Here are lists of our filters and hooks.

    Let me know if that helps,
    Jon

    • This reply was modified 3 years, 5 months ago by jpowersdev.
Viewing 1 replies (of 1 total)
  • The topic ‘Change position of checkbox’ is closed to new replies.