-
-
Save wpmark/cad5763b72b6fd66478b to your computer and use it in GitHub Desktop.
Add Salary Field to WP Job Manager Broadbean Add-on
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 | |
/** | |
* function wpjmbb_add_extra_fields | |
* adds an additional salary field to included in the | |
* wp job manager broadbean add-on plugin | |
* | |
* @params array $fields is the current array of fields to include in the XML | |
* @return array $fields is the newly modified array of fields | |
*/ | |
function wpjmbb_add_extra_fields( $fields ) { | |
/** | |
* always start your fields with an underscore | |
* this is removed in the XML and therefore this field would be sent | |
* in the XML with the node <my_salary> | |
*/ | |
$fields[ '_my_salary' ] = array( | |
'label' => 'Salary', // identifies the field in the admin | |
'placeholder' => 'e.g. £24000 / year', // placeholder text for the admin interface | |
); | |
return $fields; | |
} | |
add_filter( 'wpjmbb_fields', 'wpjmbb_add_extra_fields' ); | |
/* only needed if you want to manaually add this to the job edit screen in the wp admin */ | |
add_filter( 'job_manager_job_listing_data_fields', 'wpjmbb_add_extra_fields' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment