put @context at the top of the JSON output
This commit is contained in:
parent
c266c927da
commit
913c9aeac4
1 changed files with 7 additions and 0 deletions
|
@ -587,6 +587,13 @@ class Base_Object {
|
|||
}
|
||||
}
|
||||
|
||||
// replace 'context' key with '@context' and move it to the top.
|
||||
if ( array_key_exists( 'context', $array ) ) {
|
||||
$context = $array['context'];
|
||||
unset( $array['context'] );
|
||||
$array = array_merge( array( '@context' => $context ), $array );
|
||||
}
|
||||
|
||||
$class = new \ReflectionClass( $this );
|
||||
$class = strtolower( $class->getShortName() );
|
||||
|
||||
|
|
Loading…
Reference in a new issue