gform_date_max_year

The Gravity Forms gform date max year hook.

Description

apply_filters( 'gform_date_max_year', $date, (unknown) $form, (unknown) $instance ); 

Parameters (3)

0. $date
The date.
1. $form (unknown)
The form.
2. $instance (unknown)
The this.

Usage

To run the hook, copy the example below.
  1. $date = apply_filters( 'gform_date_max_year', $date, $form, $instance ); 
  2.  
  3. if ( !empty( $date ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the gform_date_max_year callback 
  2. function filter_gform_date_max_year( $date, $form, $instance ) { 
  3. // make filter magic happen here... 
  4. return $date
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'gform_date_max_year', 'filter_gform_date_max_year', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'gform_date_max_year', 'filter_gform_date_max_year', 10, 3 ); 

Defined (2)

The filter is defined in the following location(s).

/includes/fields/class-gf-field-date.php  
  1. $year_max = apply_filters( 'gform_date_max_year', date( 'Y' ) + 1, $form, $this ); 
  1. $year_max = apply_filters( 'gform_date_max_year', date( 'Y' ) + 1, $form, $this );