Created
November 4, 2017 05:06
-
-
Save adampatterson/7dee8e2b721c147fd879a88a75986d06 to your computer and use it in GitHub Desktop.
Listing Pro Google Address field.
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
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