Advertisement
Guest User

Untitled

a guest
Oct 9th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. if ( ! function_exists( 'jh_child_custom_job_listing_structured_data' ) ) {
  2. function jh_child_custom_job_listing_structured_data( $data, $post ) {
  3. $salary = wp_get_object_terms( $post->ID, 'job_listing_salary', array( 'fields' => 'names' ) );
  4. if ( ! empty( $salary ) ) {
  5. $data['baseSalary'] = array();
  6. $data['baseSalary']['@type'] = 'MonetaryAmount';
  7. $data['baseSalary']['currency'] = 'USD'; // Replace USD with your Currency
  8. $data['baseSalary']['value'] = array(
  9. '@type' => 'QuantitativeValue',
  10. 'value' => $salary[0],
  11. 'unitText' => 'MONTH', // Replace MONTH with your salary Period
  12. );
  13. }
  14. return $data;
  15. }
  16. }
  17. add_filter( 'wpjm_get_job_listing_structured_data', 'jh_child_custom_job_listing_structured_data', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement