| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function wl_term_jsonld_array( $jsonld_array, $term_id ) { |
||
| 16 | |||
| 17 | $entities = Jsonld_Utils::get_matched_entities_for_term( $term_id ); |
||
| 18 | |||
| 19 | if ( count( $entities ) > 0 ) { |
||
| 20 | $entity = array_shift( $entities ); |
||
| 21 | $entity['@context'] = 'http://schema.org'; |
||
| 22 | $entity['@id'] = get_term_link( $term_id ) . "/#id"; |
||
| 23 | $entity['url'] = get_term_link( $term_id ); |
||
| 24 | $entity['mainEntityOfPage'] = get_term_link( $term_id ); |
||
| 25 | $jsonld_array['jsonld'][] = $entity; |
||
| 26 | } |
||
| 27 | |||
| 28 | return $jsonld_array; |
||
| 29 | } |
||
| 30 | |||
| 31 | } |