Skip to content

Commit

Permalink
only use wp_json_encode if we have it available
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Nov 23, 2015
2 parents c002ffa + c2e9cb0 commit bdba0b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/CMB2_Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,9 @@ public function parse_picker_options( $arg = 'date', $args = array() ) {
: array();

$data[ $arg . 'Format' ] = $js_format;
$atts[ $att ] = wp_json_encode( $data );
$atts[ $att ] = function_exists( 'wp_json_encode' )
? wp_json_encode( $data )
: json_encode( $data );
}

if ( $update ) {
Expand Down

0 comments on commit bdba0b4

Please sign in to comment.