Last active
September 25, 2019 12:25
-
-
Save jom/8e45d0586161515982d1bcc4ef0c78d4 to your computer and use it in GitHub Desktop.
Override schema location without geotagging
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
add_filter( 'wpjm_get_job_listing_structured_data', function( $data ) { | |
if ( ! isset( $data['jobLocation'] ) ) { | |
$data['jobLocation'] = []; | |
$data['jobLocation']['@type'] = 'Place'; | |
} | |
if ( is_string( $data['jobLocation']['address'] ) ) { | |
$original_address = $data['jobLocation']['address']; | |
$data['jobLocation']['address'] = []; | |
$data['jobLocation']['address'] ['@type'] = 'PostalAddress'; | |
// Uncomment the line below if the string entered in the location field should be used for the streetAddress. | |
// More info on the options you can use here: https://schema.org/PostalAddress | |
// $data['jobLocation']['address'] ['streetAddress'] = $original_address; | |
} | |
$data['jobLocation']['address']['addressRegion'] = 'Valais'; | |
$data['jobLocation']['address']['addressCountry'] = 'Switzerland'; | |
return $data; | |
} ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment