-
Notifications
You must be signed in to change notification settings - Fork 27
Developer Docs
In Progress...
- yikes-mailchimp-form-title-FORM_ID
- yikes-mailchimp-form-description-FORM_ID
- yikes-mailchimp-redirect-timer
- yikes-mailchimp-before-submission
- yikes-mailchimp-before-submission-FORM_ID
Description
This filter is executed when the specified MailChimp form is rendered on the front end of your site and can be used to alter the title of a given form.
Usage
Applies to a specific form.
apply_filters( 'yikes-mailchimp-form-title-'.$form_id , apply_filters( 'the_title' , $form_name ) );Parameters
- $form_title
The form title of the specified form to alter.
Examples
This example will alter the form title on the front end of your site, for the MailChimp form with id 1 only.
function alter_mailchimp_form_title( $form_title ) {
$form_title = 'New Form Title';
return $form_title;
}
add_action( 'yikes-mailchimp-form-title-1' , 'alter_mailchimp_form_title' );Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in process_form_shortcode.php.
Description
This filter is executed when the specified MailChimp form is rendered on the front end of your site and can be used to alter the description of a given form.
Usage
Applies to a specific form.
apply_filters( 'yikes-mailchimp-form-description-'.$form_id , $form_description );Parameters
- $form_description
The form description of the specified form to alter.
Examples
This example will alter the form description on the front end of your site, for the MailChimp form with id 1 only.
function alter_mailchimp_form_description( $form_description ) {
$form_description = 'Please enter your email address and name below to sign up for our mailing list.';
return $form_description;
}
add_action( 'yikes-mailchimp-form-description-1' , 'alter_mailchimp_form_description' );Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in process_form_shortcode.php.
Description
This filter is executed after a successful form submission, and is only fired off if a redirection is set on the form.
Usage
Applies to all forms, both ajax and non-ajax.
apply_filters( 'yikes-mailchimp-redirect-timer' , $redirect_time );Parameters
- $redirect_time (in milliseconds)
The amount of time before redirecting a user to the specified page (in milliseconds).
Examples
This example will increase the amount of time before a user is redirected from 1500ms (default - 1.5 seconds) to 3000ms (3 seconds), for all forms.
function increase_redirect_time( $redirect_time ) {
$redirect_time = 3000; // must pass in milliseconds, not seconds (1s = 1000ms)
return $redirect_time;
}
add_action( 'yikes-mailchimp-redirect-timer' , 'increase_redirect_time' );Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in process_form_shortcode.php.
Description
This filter is executed after a successful form submission, and is fired off right before the data is sent over to MailChimp.
Usage
Applies to all forms, both ajax and non-ajax.
apply_filters( 'yikes-mailchimp-before-submission' , $merge_variables );Parameters
- $user_data
An array of all of the user provided data when the form was submit, including interest groups. eg:
Array (
[EMAIL] => user-email@gmail.com
[FNAME] => User First Name
[optin_time] => 2015-05-07 21:21:25
)Examples
This example will populate the first name field with the current users first name, only if they are logged in.
function populate_user_firstname( $user_data ) {
if( is_user_logged_in() ) {
get_currentuserinfo();
$user_data['FNAME'] = $current_user->user_firstname;
}
return $user_data;
}
add_filter( 'yikes-mailchimp-before-submission' , 'populate_user_firstname' );Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in process_form_submission.php & process_form_submission_ajax.php
Description
This filter is executed after a successful form submission, and is fired off right before the data is sent over to MailChimp.
Usage
Applies to a specified form, both ajax and non-ajax.
apply_filters( 'yikes-mailchimp-before-submission-'.$form , $merge_variables );Parameters
- $user_data
An array of all of the user provided data when the form was submit, including interest groups. eg:
Array (
[EMAIL] => user-email@gmail.com
[FNAME] => User First Name
[optin_time] => 2015-05-07 21:21:25
)after the filter below is executed, the result would then be (assuming the current logged in users first name is John):
Array (
[EMAIL] => user-email@gmail.com
[FNAME] => John
[optin_time] => 2015-05-07 21:21:25
)Examples
This example will populate the first name field with the current users first name, only if they are logged in. This will only effect the form with id 1.
function populate_user_firstname( $user_data ) {
if( is_user_logged_in() ) {
get_currentuserinfo();
$user_data['FNAME'] = $current_user->user_firstname;
}
return $user_data;
}
add_filter( 'yikes-mailchimp-before-submission-1' , 'populate_user_firstname' );after the filter below is executed, the result would then be (assuming the current logged in users first name is John):
Array (
[EMAIL] => user-email@gmail.com
[FNAME] => John
[optin_time] => 2015-05-07 21:21:25
)Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in process_form_submission.php & process_form_submission_ajax.php
Home | About YIKES | Setup | Plugin Usage | Developer Documentation | Support | Copyright © 1996-2015 YIKES Inc.