Edit Salary Field in WP Broadbean
<?php | |
/** | |
* Edits the salary currency field in WP Broadbean by first removing it and | |
* then re-adding it back in with an additional currency for USD in the select. | |
* | |
* @param arrray $fields The current array of fields. | |
* @return array The modified array if fields. | |
*/ | |
function wpmark_edit_salary_currency_field( $fields ) { | |
// remove the salary currency field by unsetting from the array. | |
unset( $fields['salary_currency'] ); | |
// add a new field for salary dropdown with the same meta key and bb field. | |
$fields['salary_currency'] = array( | |
'name' => __( 'Salary Currency', 'wpbroadbean' ), | |
'id' => '_wpbb_job_salary_currency', | |
'bb_field' => 'salary_currency', | |
'type' => 'select', | |
'options' => array( | |
'zero' => 'Select', | |
'GBP' => 'GBP', | |
'EUR' => 'Euro', | |
'USD' => 'USD', | |
), | |
'cols' => 6, | |
'show_on_frontend' => false | |
); | |
// return the modified fields. | |
return $fields; | |
} | |
add_filter( 'wpbb_job_fields', 'wpmark_edit_salary_currency_field', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment