Skip to content

Commit

Permalink
Merge pull request #670 from contactashish13/issue-669
Browse files Browse the repository at this point in the history
JSON: Add ability to manipulate data before processing
  • Loading branch information
rodica-andronache authored Apr 14, 2020
2 parents 22320e3 + 136e191 commit 95a1dc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes/Visualizer/Source/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ private function getJSON( $url = null ) {
return null;
}

$array = json_decode( wp_remote_retrieve_body( $response ), true );
// this filter can be used to rearrange columns e.g. in candlestick charts
// or to add additional data to the root.
$array = apply_filters( 'visualizer_json_massage_data', json_decode( wp_remote_retrieve_body( $response ), true ), $url );

do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'JSON array for the endpoint is %s = ', print_r( $array, true ) ), 'debug', __FILE__, __LINE__ );

Expand Down

0 comments on commit 95a1dc9

Please sign in to comment.