原型

json_encode( $string )

源文件

路径:wp-includes/compat.php

<?php
...
	function json_encode( $string ) {
		global $wp_json;
		if ( ! ( $wp_json instanceof Services_JSON ) ) {
			require_once( ABSPATH . WPINC . '/class-json.php' );
			$wp_json = new Services_JSON();
		}
		return $wp_json->encodeUnsafe( $string );
	}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/json_encode/