gde_output_json
Output/download requested JSON data.
Description
Parameters (3)
- 0. $json
- The json.
- 1. $save — Optional. (constant) =>
false
- The save.
- 2. $file — Optional. (string) =>
''
- The file.
Usage
if ( !function_exists( 'gde_output_json' ) ) { require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/libs/lib-service.php'; } // The json. $json = null; // The save. $save = false; // The file. $file = ''; // NOTICE! Understand what this does before running. $result = gde_output_json($json, $save, $file);
Defined (1)
The function is defined in the following location(s).
- /libs/lib-service.php
- function gde_output_json( $json, $save = false, $file = '' ) {
- if ( $save && ! empty( $file ) ) {
- header('Content-disposition: attachment; filename=' . $file . '.json' );
- }
- header('Content-type: application/json');
- echo $json;
- exit;
- }