Skip to content

Instantly share code, notes, and snippets.

@adampatterson
Created November 4, 2017 05:06
Show Gist options
  • Save adampatterson/7dee8e2b721c147fd879a88a75986d06 to your computer and use it in GitHub Desktop.
Save adampatterson/7dee8e2b721c147fd879a88a75986d06 to your computer and use it in GitHub Desktop.
Listing Pro Google Address field.
function get_listingpro_meta(){
$meta = get_post_custom_values('lp_listingpro_options');
return unserialize($meta[0]);
}
function get_listingpro_address($test) {
$listing_meta = get_listingpro_meta();
if(array_key_exists('gAddress', $listing_meta)){
return $listing_meta['gAddress'];
}
}
function register_custom_yoast_variables() {
wpseo_register_var_replacement( '%%lp_address%%', 'get_listingpro_address', 'advanced', 'Listing Pro Google Address field.' );
}
// Add action
add_action( 'wpseo_register_extra_replacements', 'register_custom_yoast_variables' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment