Created
March 11, 2020 19:24
-
-
Save djrmom/ea98f85eb1309123337fd571ee77f283 to your computer and use it in GitHub Desktop.
facetwp custom data in 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 | |
/** return custom data in the json facet returns on refresh | |
** access with FWP.settings.my_data in JS | |
*/ | |
add_filter( 'facetwp_render_output', function( $output, $params ) { | |
$output['settings']['my_data'] = 'some data'; | |
return $output; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment