Created
July 28, 2014 18:10
-
-
Save maxchirkov/e586683bd21614adc0b5 to your computer and use it in GitHub Desktop.
Neighborhood data based on listing
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
<?php | |
add_action('the_content', 'demographics'); | |
function demographics($content) | |
{ | |
global $post; | |
if (!isset($post->listing)) | |
return $content; | |
$circle = $post->listing->coordinates_latitude . ':' . $post->listing->coordinates_longitude . ':1'; | |
// Assign value to the neighborhood var | |
$neighborhood = $post->listing->subdivision; | |
$apiController = \hji\membership\Membership::getInstance()->apiController; | |
$params = array('name' => $neighborhood, 'circle' => $circle, 'details' => true); | |
$result = $apiController->api->searchNeighborhoods($params); | |
return $content . '<pre>' . print_r($result, true) . '</pre>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment