Last active
January 17, 2018 20:35
-
-
Save mgibbs189/7fd4403945678929734f82504c9eabc7 to your computer and use it in GitHub Desktop.
FacetWP - stick custom data into FWP_JSON
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_filter( 'facetwp_assets', function( $assets ) { | |
// Populate "FWP_JSON.neighborhood_data" | |
FWP()->display->json['neighborhood_data'] = array( | |
'academy' => array( | |
'title' => 'Academy', | |
'description' => 'This is the description', | |
'image' => 'http://image.url', | |
), | |
'airport' => array( | |
'title' => 'Airport', | |
'description' => 'This is the description', | |
'image' => 'http://image.url', | |
) | |
); | |
// Return the same thing (since we're hijacking this hook) | |
return $assets; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment