wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
wp_json_encode › WordPress Function
Da4.1.0
Deprecaton/a
› wp_json_encode ( $value, $flags = 0, $depth = 512 )
Parametri: (3) |
|
Ritorna: |
|
Definito a: |
|
Codex: | |
ChangeLog: |
|
Encodes a variable into JSON, with some confidence checks.
Funzioni correlate: wp_json_file_decode, wp_send_json_error, wp_is_json_media_type, wp_is_json_request, wp_encode_emoji
Sorgenti
function wp_json_encode( $value, $flags = 0, $depth = 512 ) { $json = json_encode( $value, $flags, $depth ); // If json_encode() was successful, no need to do more confidence checking. if ( false !== $json ) { return $json; } try { $value = _wp_json_sanity_check( $value, $depth ); } catch ( Exception $e ) { return false; } return json_encode( $value, $flags, $depth ); }