Skip Navigation

[Resolved] Importing relationship using CSV Importer Custom fields Pro

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by leonardoL 6 years, 4 months ago.

Author
Posts
#600418

Hi I'm trying to import the id values with CSV Importer Custom fields Pro (_wpcf_belongs_obra_id) but it doesn't work.

The parent is obra and the child is fotografia, I tried using a custom field and some scripts that I found here but nothing.

This script works but only for the first 5 post,

require "wp-config.php";
$childs = get_posts('post_type=fotografia');
foreach ($childs as $child) {
$old_id = get_post_meta($child->ID, 'wpcf-relacionobra', true);
$parents = get_posts('post_type=obra&meta_key=id-relacion&meta_value=' . $old_id);
update_post_meta($child->ID, '_wpcf_belongs_obra_id', $parents[0]->ID);
}

Could you help me please?

#600598

Solved by plugin developer.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.