Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! function_exists( 'jh_child_custom_job_listing_structured_data' ) ) {
- function jh_child_custom_job_listing_structured_data( $data, $post ) {
- $salary = wp_get_object_terms( $post->ID, 'job_listing_salary', array( 'fields' => 'names' ) );
- if ( ! empty( $salary ) ) {
- $data['baseSalary'] = array();
- $data['baseSalary']['@type'] = 'MonetaryAmount';
- $data['baseSalary']['currency'] = 'USD'; // Replace USD with your Currency
- $data['baseSalary']['value'] = array(
- '@type' => 'QuantitativeValue',
- 'value' => $salary[0],
- 'unitText' => 'MONTH', // Replace MONTH with your salary Period
- );
- }
- return $data;
- }
- }
- 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