Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active May 2, 2018 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/3b9dbc2a4f2d3c16313aea6d35f63982 to your computer and use it in GitHub Desktop.
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)
<?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