Okay I looked at both of these files and I don't see any false positives here. All the code that was caught by the migration tool should be updated to work with the new relationships syntax. For example, starting at line 163 of functions.php:
$post_meta_id .= get_post_meta($post_id,"_wpcf_belongs_local-source_id",true);
$post_cont_id .= get_post_meta($post_meta_id,"_wpcf_belongs_connector_id",true);
Instead of using get_post_meta to get the parent post ID, you should now use the API toolset_get_parent_post_by_type:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_parent_post_by_type
$post_meta_id = toolset_get_parent_post_by_type( $post_id, 'local-source' ); // assuming local-source is parent post type slug
$post_cont_id = toolset_get_parent_post_by_type( $post_meta_id, 'connector' ); // assuming connector is parent post type slug
The code above can also be used as a template to resolve the functions.php errors on the following lines:
178
179
194
195
211
212
233
234
249
250
Now let's look at functions.php line 197:
$results = $wpdb->get_results( "SELECT * FROM wp_postmeta WHERE meta_key = '_wpcf_belongs_connector_id' AND meta_value = $post_cont_id
",OBJECT);
It looks like you want to find "trigger" posts that are children of the Connector post with $post_cont_id as the Connector post ID. Now you can use the toolset_get_related_posts API to accomplish this:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts
$results = toolset_get_related_posts(
// get posts related to this one
$post_cont_id,
// legacy relationship array syntax
array( 'connector', 'trigger'),
// additional arguments
[
'query_by_role' => 'parent',
'limit' => 10000,
'offset' => 0,
'args' => [],
'role_to_return' => 'other',
'return' => 'post_object'
]
);
Now you can see that we are querying specifically for trigger posts, so you can eliminate the conditional block for get_post_type that follows a few lines below.
The instructions and the code example above can also be used as a template to resolve the warnings mentioned on the following lines:
197
213
235
251
Finally, look at my-account-documentation.php starting at line 39:
$args = array(
'post_type' => 'kb-article',
'meta_query' => array(
array(
'key' => '_wpcf_belongs_product_id',
'value' => $productid,
'compare' => '=',
),
),
'post__not_in' => array($productid),
);
$child_posts = get_posts($args);
Again, you can use the toolset_get_related_posts API to retrieve these child posts:
$child_posts = toolset_get_related_posts(
// get posts related to this one
$productid,
// legacy relationship array syntax
array( 'product', 'kb-article'),
// additional arguments
[
'query_by_role' => 'parent',
'limit' => 10000,
'offset' => 0,
'args' => [],
'role_to_return' => 'other',
'return' => 'post_object'
]
);
I recommend making these modifications and testing on a staging environment before attempting to migrate the live site. Let me know if you have questions about the code updates and I can try to clarify.