wp_update_post: move custom field to taxonomy
-
Hi Rachel,
I got an existing site with info saved in custom fields. I recently created a custom post type and added it as custom taxonomy to my regular posts.
I`m trying to move the custom field value to the connected taxonomy via wp_update_post. I tried all kinds of values manually but the taxonomy does not accept anything (id,slug,name). My last idea is that there is some collision with the cpt-onomies plugin? (which is awesome btw :))
the key part is this:$customfield_value = 'tom hanks'; $post = array( 'ID' => 14, 'tax_input' => array( 'actor' => array( $customfield_value ) ) ); wp_update_post( $post );
The complete source is here – maby you got a minute to look into it?
https://wordpress.stackexchange.com/questions/112691/sql-wp-update-post-change-post-custom-field-to-cpt-post-taxonomy
(hope it’s ok to link to that post here?)Thanks a lot for time.
Gerald
- The topic ‘wp_update_post: move custom field to taxonomy’ is closed to new replies.