Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save propertyhive/f00cd3904dcba8906a949e836bfc96ae to your computer and use it in GitHub Desktop.
Save propertyhive/f00cd3904dcba8906a949e836bfc96ae to your computer and use it in GitHub Desktop.
add_action( "propertyhive_property_imported_loop_json", 'set_negotiator_from_loop', 10, 3 );
function set_negotiator_from_loop( $post_id, $property, $import_id )
{
// Negotiator A
if ( $import_id == 111 ) // change 111 for import ID
{
update_post_meta( $post_id, '_negotiator_id', 1 ); // change 1 for WP user ID
}
// Negotiator B
if ( $import_id == 222 ) // change 222 for import ID
{
update_post_meta( $post_id, '_negotiator_id', 2 ); // change 2 for WP user ID
}
// Negotiator C
if ( $import_id == 333 ) // change 333 for import ID
{
update_post_meta( $post_id, '_negotiator_id', 3 ); // change 3 for WP user ID
}
/// and so forth
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment