• Resolved Ve Mer

    (@vmercader)


    I’m looking at shortcode_form.php

    and based on the form structure, there’s this yks_mc_before_all_forms where in my assumption, is something where you can put some extra words or headings or even a logo.

    How do I add content to yks_mc_before_all_forms?

    <div class="yks-mailchimpFormContainer col-lg-6 col-md-6 col-sm-12 col-xs-12">
    	<div class="yks-status" id="yks-status-<?php echo $list['id']; ?>"></div>
    
    	<?php 
    
    		// custom action to print text before ALL forms
    		do_action( 'yks_mc_before_all_forms');
    
    		// custom action to print text for a specific form
    		// using the form ID
    		$form_id = explode('-', $list['id']);
    		do_action( 'yks_mc_before_form_'.$form_id[1] );
    
    	?>

    https://www.ads-software.com/plugins/yikes-inc-easy-mailchimp-extender/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Hi Vmercader,

    You are correct in your assumption. That is a hook we have provided for users to hook into to add any sort of text or images that they would like. We have an extended developer documentation where we outline all of our hooks and filters in both the other notes section and on our github readme.md file.

    We have working examples of how to use them, but for the sake of looking it up yourself here is the yks_mc_before_all_forms hook example:

    /**
    * This example will print out a disclaimer to the user,
    * above all MailChimp forms.
    */
    function custom_before_all_forms_action() {
        echo '<p><em>Your information is for internal use only, and will never be shared with or sold to anyone.</em></p>';
    }
    add_action( 'yks_mc_before_all_forms' , 'custom_before_all_forms_action' );

    You can also hook into specific forms, to only show a message or image on a single form by attaching the form id to the end of the hook. For example if my form id were adf9531235 I could hook into the form by doing:

    /**
    * This example will print out a disclaimer to the user,
    * above the MailChimp form with ID adf9531235.
    */
    function custom_before_all_forms_action() {
        echo '<p><em>Your information is for internal use only, and will never be shared with or sold to anyone.</em></p>';
    }
    add_action( 'yks_mc_before_form_adf9531235' , 'custom_before_all_forms_action' );

    Let us know how that works for you.

    Thanks,
    Evan

    Thread Starter Ve Mer

    (@vmercader)

    It works! Thank you. I was able to attach the hook into a single.php file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘yks_mc_before_all_forms ?’ is closed to new replies.