SHARE
TWEET

Untitled

a guest Oct 9th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top