| Conditions | 6 |
| Paths | 5 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function entity_jsonld( $jsonld, $post_id ) { |
||
|
|
|||
| 26 | |||
| 27 | // Bail out if it's not a Product or the offers property isn't set. |
||
| 28 | if ( ! in_array( 'Product', (array) $jsonld['@type'] ) || ! isset( $jsonld['offers'] ) ) { |
||
| 29 | return $jsonld; |
||
| 30 | } |
||
| 31 | |||
| 32 | if ( ! is_array( $jsonld['offers'] ) || ! is_numeric( key( $jsonld['offers'] ) ) ) { |
||
| 33 | $jsonld['offers'] = array( $jsonld['offers'] ); |
||
| 34 | } |
||
| 35 | |||
| 36 | foreach ( $jsonld['offers'] as &$offer ) { |
||
| 37 | $this->shipping_zones->add_available_delivery_method( $offer ); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $jsonld; |
||
| 41 | } |
||
| 42 | |||
| 44 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.