Retrieval of member IDs for getting trail product links changed to suit the Advanced...
authorLaury GvR <laury@gaslightmedia.com>
Fri, 5 May 2017 17:36:46 +0000 (13:36 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 5 May 2017 17:36:46 +0000 (13:36 -0400)
functions.php

index 8178122..b58eb78 100644 (file)
@@ -238,7 +238,7 @@ add_filter('glm-get-trail-links', function($member_id) {
         // Get all the categories for the given product
         $categories = wp_get_post_terms( $product->ID, 'product_cat' );
         // Explode the (hopefully) comma-separated list of member IDs into an array
-        $member_ids_for_product = explode(',',get_post_meta( $product->ID, 'trail_id', true));
+        $member_ids_for_product = explode(',', get_field( 'trail_id', $product->ID ) );
 
         // If the current member is in the list of IDs
         if (in_array($member_id, $member_ids_for_product)) {