@@ -6,40 +6,40 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Free_Shipping_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method( &$jsonld ) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | - $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | - } |
|
| 11 | + if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | + $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | - } |
|
| 15 | + if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | - } |
|
| 19 | + if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | + array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | - $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | - } |
|
| 27 | + if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | + $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | - ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 31 | + $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | + ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 33 | 33 | |
| 34 | - $offer_shipping_details['shippingRate'][] = array( |
|
| 35 | - '@type' => 'MonetaryAmount', |
|
| 36 | - 'name' => $this->wc_shipping_method->get_title(), |
|
| 37 | - 'description' => $description, |
|
| 38 | - 'value' => '0', |
|
| 39 | - 'currency' => get_woocommerce_currency(), |
|
| 40 | - ); |
|
| 34 | + $offer_shipping_details['shippingRate'][] = array( |
|
| 35 | + '@type' => 'MonetaryAmount', |
|
| 36 | + 'name' => $this->wc_shipping_method->get_title(), |
|
| 37 | + 'description' => $description, |
|
| 38 | + 'value' => '0', |
|
| 39 | + 'currency' => get_woocommerce_currency(), |
|
| 40 | + ); |
|
| 41 | 41 | |
| 42 | - } |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | } |
@@ -6,30 +6,30 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Free_Shipping_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method(&$jsonld) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 11 | + if ( ! isset($jsonld['availableDeliveryMethod'])) { |
|
| 12 | 12 | $jsonld['availableDeliveryMethod'] = array(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 15 | + if ( ! is_array($jsonld['availableDeliveryMethod'])) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array($jsonld['availableDeliveryMethod']); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 19 | + if ( ! in_array('ParcelDelivery', $jsonld['availableDeliveryMethod'])) { |
|
| 20 | + array_push($jsonld['availableDeliveryMethod'], 'ParcelDelivery'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate(&$offer_shipping_details) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 27 | + if ( ! isset($offer_shipping_details['shippingRate'])) { |
|
| 28 | 28 | $offer_shipping_details['shippingRate'] = array(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | - ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 31 | + $description = isset($this->wc_shipping_method->instance_settings['description']) |
|
| 32 | + ? wp_strip_all_tags($this->wc_shipping_method->instance_settings['description']) : ''; |
|
| 33 | 33 | |
| 34 | 34 | $offer_shipping_details['shippingRate'][] = array( |
| 35 | 35 | '@type' => 'MonetaryAmount', |
@@ -6,39 +6,39 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Flat_Rate_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method( &$jsonld ) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | - $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | - } |
|
| 11 | + if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | + $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | - } |
|
| 15 | + if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | - } |
|
| 19 | + if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | + array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | - $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | - } |
|
| 27 | + if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | + $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | - ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 31 | + $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | + ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 33 | 33 | |
| 34 | - $offer_shipping_details['shippingRate'][] = array( |
|
| 35 | - '@type' => 'MonetaryAmount', |
|
| 36 | - 'name' => $this->wc_shipping_method->get_title(), |
|
| 37 | - 'description' => $description, |
|
| 38 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ), |
|
| 39 | - 'currency' => get_woocommerce_currency(), |
|
| 40 | - ); |
|
| 34 | + $offer_shipping_details['shippingRate'][] = array( |
|
| 35 | + '@type' => 'MonetaryAmount', |
|
| 36 | + 'name' => $this->wc_shipping_method->get_title(), |
|
| 37 | + 'description' => $description, |
|
| 38 | + 'value' => $this->wc_shipping_method->get_option( 'cost' ), |
|
| 39 | + 'currency' => get_woocommerce_currency(), |
|
| 40 | + ); |
|
| 41 | 41 | |
| 42 | - } |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | } |
@@ -6,36 +6,36 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Flat_Rate_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method(&$jsonld) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 11 | + if ( ! isset($jsonld['availableDeliveryMethod'])) { |
|
| 12 | 12 | $jsonld['availableDeliveryMethod'] = array(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 15 | + if ( ! is_array($jsonld['availableDeliveryMethod'])) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array($jsonld['availableDeliveryMethod']); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 19 | + if ( ! in_array('ParcelDelivery', $jsonld['availableDeliveryMethod'])) { |
|
| 20 | + array_push($jsonld['availableDeliveryMethod'], 'ParcelDelivery'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate(&$offer_shipping_details) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 27 | + if ( ! isset($offer_shipping_details['shippingRate'])) { |
|
| 28 | 28 | $offer_shipping_details['shippingRate'] = array(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | - ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 31 | + $description = isset($this->wc_shipping_method->instance_settings['description']) |
|
| 32 | + ? wp_strip_all_tags($this->wc_shipping_method->instance_settings['description']) : ''; |
|
| 33 | 33 | |
| 34 | 34 | $offer_shipping_details['shippingRate'][] = array( |
| 35 | 35 | '@type' => 'MonetaryAmount', |
| 36 | 36 | 'name' => $this->wc_shipping_method->get_title(), |
| 37 | 37 | 'description' => $description, |
| 38 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ), |
|
| 38 | + 'value' => $this->wc_shipping_method->get_option('cost'), |
|
| 39 | 39 | 'currency' => get_woocommerce_currency(), |
| 40 | 40 | ); |
| 41 | 41 | |
@@ -6,39 +6,39 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Local_Pickup_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method( &$jsonld ) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | - $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | - } |
|
| 11 | + if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | + $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | - } |
|
| 15 | + if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - if ( ! in_array( 'OnSitePickup', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'OnSitePickup' ); |
|
| 21 | - } |
|
| 19 | + if ( ! in_array( 'OnSitePickup', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | + array_push( $jsonld['availableDeliveryMethod'], 'OnSitePickup' ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | - $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | - } |
|
| 27 | + if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | + $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | - ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 31 | + $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | + ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 33 | 33 | |
| 34 | - $offer_shipping_details['shippingRate'][] = array( |
|
| 35 | - '@type' => 'MonetaryAmount', |
|
| 36 | - 'name' => $this->wc_shipping_method->get_title(), |
|
| 37 | - 'description' => $description, |
|
| 38 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ) ?: '0', |
|
| 39 | - 'currency' => get_woocommerce_currency(), |
|
| 40 | - ); |
|
| 34 | + $offer_shipping_details['shippingRate'][] = array( |
|
| 35 | + '@type' => 'MonetaryAmount', |
|
| 36 | + 'name' => $this->wc_shipping_method->get_title(), |
|
| 37 | + 'description' => $description, |
|
| 38 | + 'value' => $this->wc_shipping_method->get_option( 'cost' ) ?: '0', |
|
| 39 | + 'currency' => get_woocommerce_currency(), |
|
| 40 | + ); |
|
| 41 | 41 | |
| 42 | - } |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | } |
@@ -6,36 +6,36 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Local_Pickup_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method(&$jsonld) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 11 | + if ( ! isset($jsonld['availableDeliveryMethod'])) { |
|
| 12 | 12 | $jsonld['availableDeliveryMethod'] = array(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 15 | + if ( ! is_array($jsonld['availableDeliveryMethod'])) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array($jsonld['availableDeliveryMethod']); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( ! in_array( 'OnSitePickup', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'OnSitePickup' ); |
|
| 19 | + if ( ! in_array('OnSitePickup', $jsonld['availableDeliveryMethod'])) { |
|
| 20 | + array_push($jsonld['availableDeliveryMethod'], 'OnSitePickup'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate(&$offer_shipping_details) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 27 | + if ( ! isset($offer_shipping_details['shippingRate'])) { |
|
| 28 | 28 | $offer_shipping_details['shippingRate'] = array(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $description = isset( $this->wc_shipping_method->instance_settings['description'] ) |
|
| 32 | - ? wp_strip_all_tags( $this->wc_shipping_method->instance_settings['description'] ) : ''; |
|
| 31 | + $description = isset($this->wc_shipping_method->instance_settings['description']) |
|
| 32 | + ? wp_strip_all_tags($this->wc_shipping_method->instance_settings['description']) : ''; |
|
| 33 | 33 | |
| 34 | 34 | $offer_shipping_details['shippingRate'][] = array( |
| 35 | 35 | '@type' => 'MonetaryAmount', |
| 36 | 36 | 'name' => $this->wc_shipping_method->get_title(), |
| 37 | 37 | 'description' => $description, |
| 38 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ) ?: '0', |
|
| 38 | + 'value' => $this->wc_shipping_method->get_option('cost') ?: '0', |
|
| 39 | 39 | 'currency' => get_woocommerce_currency(), |
| 40 | 40 | ); |
| 41 | 41 | |
@@ -12,54 +12,54 @@ |
||
| 12 | 12 | class Entity_List_Utils { |
| 13 | 13 | |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * @param $term_id int Term id. |
|
| 17 | - * @param $entities array An array of entities |
|
| 18 | - * |
|
| 19 | - * @return array<array> An Array of entities with isActive filter. |
|
| 20 | - */ |
|
| 21 | - public static function mark_is_active_for_entities( $term_id, $entities ) { |
|
| 15 | + /** |
|
| 16 | + * @param $term_id int Term id. |
|
| 17 | + * @param $entities array An array of entities |
|
| 18 | + * |
|
| 19 | + * @return array<array> An Array of entities with isActive filter. |
|
| 20 | + */ |
|
| 21 | + public static function mark_is_active_for_entities( $term_id, $entities ) { |
|
| 22 | 22 | |
| 23 | - $active_entities = self::get_active_entities( $term_id ); |
|
| 23 | + $active_entities = self::get_active_entities( $term_id ); |
|
| 24 | 24 | |
| 25 | - if ( ! is_array( $entities ) ) { |
|
| 26 | - return $entities; |
|
| 27 | - } |
|
| 25 | + if ( ! is_array( $entities ) ) { |
|
| 26 | + return $entities; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - foreach ( $entities as &$entity ) { |
|
| 30 | - $entity_id = $entity['entityId']; |
|
| 31 | - $entity['isActive'] = in_array( $entity_id, $active_entities ); |
|
| 32 | - } |
|
| 29 | + foreach ( $entities as &$entity ) { |
|
| 30 | + $entity_id = $entity['entityId']; |
|
| 31 | + $entity['isActive'] = in_array( $entity_id, $active_entities ); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - return $entities; |
|
| 35 | - } |
|
| 34 | + return $entities; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @param $term_id |
|
| 40 | - * |
|
| 41 | - * @return array<string> An array of Entity URIs |
|
| 42 | - */ |
|
| 43 | - public static function get_active_entities( $term_id ) { |
|
| 38 | + /** |
|
| 39 | + * @param $term_id |
|
| 40 | + * |
|
| 41 | + * @return array<string> An array of Entity URIs |
|
| 42 | + */ |
|
| 43 | + public static function get_active_entities( $term_id ) { |
|
| 44 | 44 | |
| 45 | - // retrieve jsonld data. |
|
| 46 | - $entity = Entity_List_Factory::get_instance( $term_id ); |
|
| 45 | + // retrieve jsonld data. |
|
| 46 | + $entity = Entity_List_Factory::get_instance( $term_id ); |
|
| 47 | 47 | |
| 48 | - $entity_data_list = $entity->get_jsonld_data(); |
|
| 48 | + $entity_data_list = $entity->get_jsonld_data(); |
|
| 49 | 49 | |
| 50 | - $active_entity_ids = array(); |
|
| 50 | + $active_entity_ids = array(); |
|
| 51 | 51 | |
| 52 | - foreach ( $entity_data_list as $item ) { |
|
| 53 | - $sameas = $item['sameAs']; |
|
| 54 | - if ( is_array( $sameas ) && count( $sameas ) > 0 ) { |
|
| 55 | - // The entity id is stored on last position, so |
|
| 56 | - // we get the entity id from there. |
|
| 57 | - $active_entity_ids[] = array_pop( $sameas ); |
|
| 58 | - } |
|
| 59 | - } |
|
| 52 | + foreach ( $entity_data_list as $item ) { |
|
| 53 | + $sameas = $item['sameAs']; |
|
| 54 | + if ( is_array( $sameas ) && count( $sameas ) > 0 ) { |
|
| 55 | + // The entity id is stored on last position, so |
|
| 56 | + // we get the entity id from there. |
|
| 57 | + $active_entity_ids[] = array_pop( $sameas ); |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | - return $active_entity_ids; |
|
| 63 | - } |
|
| 62 | + return $active_entity_ids; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | 65 | } |