Last active
May 2, 2018 22:54
-
-
Save tripflex/3b9dbc2a4f2d3c16313aea6d35f63982 to your computer and use it in GitHub Desktop.
Add a custom Range field type in WP Job Manager Applications addon plugin (requires WP Job Manager Field Editor for range field type support)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'job_application_form_fields', 'smyles_custom_add_range_app_field' ); | |
function smyles_custom_add_range_app_field( $fields ) { | |
$fields['some_range_field'] = array( | |
'label' => __( 'Range Example' ), | |
'description' => '', | |
'type' => 'range', | |
'required' => true, | |
'placeholder' => '', | |
'priority' => 2, | |
'min' => '1000', | |
'max' => '100000', | |
'step' => '100', // increment value by this amount each time | |
'append' => '/week', | |
'prepend' => '$', | |
'rules' => array() | |
); | |
return $fields; | |
} | |
add_filter( 'job_application_form_field_types', 'smyles_add_range_field_type_to_app_fields' ); | |
function smyles_add_range_field_type_to_app_fields( $types ){ | |
$types['range'] = __( 'Range (Field Editor)' ); | |
return $types; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment