Skip to content

Developer Docs

Evan Herman edited this page May 6, 2015 · 59 revisions

In Progress...

Filters

  1. yikes-mailchimp-form-title-FORM_ID
  2. yikes-mailchimp-form-description-FORM_ID
  3. yikes-mailchimp-redirect-timer
  4. yikes-mailchimp-redirect-timer-FORM_ID

1. yikes-mailchimp-form-title-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.


2. yikes-mailchimp-form-description-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 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.


3. yikes-mailchimp-redirect-timer

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.


Clone this wiki locally