11/16/2018 at 12:00 pm
#477196
Keymaster
@ Joshua
RE: How do I assign the user column to a new cnEntry?
$entry->setUser( $id );
$id is the WP user ID.
RE: Can you explain further on how to assign multiple categories to the cnEntry?
Connections_Directory()->term->setTermRelationships( $entry->getId(), array( $term1, $term2, $term3, [...] ), 'category' );
The $term variables are the category ID numbers. The array contains the ID of all categories you wish to attach to the entry. It basically works the same way that the core WP function to attach categories to posts; wp_set_object_terms().
Hope that helps!
