Default values for custom fields and multiselect types
-
There seems to be an issue where default values for custom fields are not being displayed. For example when I clicked Edit resume and submitted a value and an error was fired it did not keep my posted value. I put this in the custom field:
$fields['resume_fields']['candidate_address'] = array( 'label' => __('Address', 'wp-job-manager-resumes'), 'type' => 'text', 'required' => 1, 'placeholder' => 'Your full address', 'priority' => 1.1, 'value' => isset($_POST['candidate_address']) ? $_POST['candidate_address'] : get_user_meta($user_id, 'addr1', 1) );
As you can see it should put the post data in the value, but it doesn’t. I even set it as static and it still showed as a blank value. Which means if someone submits a bunch of data and an error is thrown, everything they submitted is gone ??
Also the get_posted_field() method in class-wp-resume-manager-form-submit-resume.php is not checking for multiselect fields, ie an array which then means that an error is thrown. The multiselect-form.php template also doesn’t have a place for a description, which would be nice. I overrode it in mine, but it seems like most people would want to put the instructions of how to multiselect on the different PC platforms.
- The topic ‘Default values for custom fields and multiselect types’ is closed to new replies.