| @@ 116-125 (lines=10) @@ | ||
| 113 | * |
|
| 114 | * @return array An array with the updated JSON-LD and references. |
|
| 115 | */ |
|
| 116 | public function wl_post_jsonld_array( $value, $post_id ) { |
|
| 117 | ||
| 118 | $jsonld = $value['jsonld']; |
|
| 119 | $references = $value['references']; |
|
| 120 | ||
| 121 | return array( |
|
| 122 | 'jsonld' => $this->build_jsonld( $jsonld, $post_id, $references, self::POST ), |
|
| 123 | 'references' => $references, |
|
| 124 | ); |
|
| 125 | } |
|
| 126 | ||
| 127 | /** |
|
| 128 | * Returns JSON-LD data after applying transformation functions. |
|
| @@ 19-31 (lines=13) @@ | ||
| 16 | add_filter( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 11, 2 ); |
|
| 17 | } |
|
| 18 | ||
| 19 | public function wl_post_jsonld_array( $arr, $post_id ) { |
|
| 20 | ||
| 21 | $jsonld = $arr['jsonld']; |
|
| 22 | $references = $arr['references']; |
|
| 23 | ||
| 24 | $this->add_mentions( $post_id, $jsonld, $references ); |
|
| 25 | ||
| 26 | return array( |
|
| 27 | 'jsonld' => $jsonld, |
|
| 28 | 'references' => $references |
|
| 29 | ); |
|
| 30 | ||
| 31 | } |
|
| 32 | ||
| 33 | public function add_mentions( $post_id, &$jsonld, &$references ) { |
|
| 34 | ||