WordPress.org

Support

Support » How-To and Troubleshooting » wp_set_object_terms problem

wp_set_object_terms problem

  • btray1977
    Member

    @btray1977

    I’m using custom taxonomies to create a taxonomy called ‘catalog’. In this I’m programmically inserting the terms. The terms do not show up in the admin unless I edit the terms manually in the admin.

    This also affects the end user when going to website.com/catalog/{term name goes here} when it has no items in it (child terms may have items in them). It gives me a 404 error. As soon as I edit the terms in the admin manually there is no more 404 error issue.

    example code of what I’m using:
    $category = array(‘one’,’two’,’three’,’four’);

    foreach ( $category as $cat )
    {
    $categoryname[] = get_term( $cat, ‘catalog’ );
    }
    foreach ( $categoryname as $cat )
    {
    $term_id = wp_set_object_terms( $postID, $cat->slug, ‘catalog’, false );
    }

    Screen grab of admin showing problem. Notice drop down list has all items, but list does not.

    http://i30.tinypic.com/s49nav.jpg

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_set_object_terms problem’ is closed to new replies.