Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter gerald@WPcustoms

    (@geeman12030)

    This code is exactly what I’m trying to do but the actor does not get updated.

    global $cpt_onomy;
    $cpt_onomy->wp_set_post_terms( 14, array( 'brad-pitt' ), 'actor', true );

    I tried with a CPT created by myself and also the built-in CPT create-tool from CPT-ononmies.
    wp_set_object_terms does not work either.
    https://wpdreamer.com/plugins/cpt-onomies/documentation/wp_set_post_terms/

    Thread Starter gerald@WPcustoms

    (@geeman12030)

    sorry – too late to edit the old comment.

    I got it working to update the post_tag taxononmy but as soon as I use my CPT-name nothing happens.
    $cpt_onomy->wp_set_post_terms( 14, 'adding-this-tag', 'post_tag', true );

    I rechecked the CPT name and everything. All plugins are disabled except CPT-onomies. Also tried with default twentytwelve theme. WP version 3.6

    When I use
    $cpt_onomy->wp_delete_object_term_relationships( 14, 'actor', true );
    I get this error:
    Warning: array_map() [function.array-map]: Argument #2 should be an array in \wp-includes\taxonomy.php on line 1733
    it seems I cannot directly adress the cpt name this way?!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_update_post: move custom field to taxonomy’ is closed to new replies.