Skip to content

Instantly share code, notes, and snippets.

@wpmark
Last active March 11, 2016 10:57
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 wpmark/cad5763b72b6fd66478b to your computer and use it in GitHub Desktop.
Save wpmark/cad5763b72b6fd66478b to your computer and use it in GitHub Desktop.
Add Salary Field to WP Job Manager Broadbean Add-on
<?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