[resolved] problem with term containing ampsersand when calling wp_set_post_terms() (3 posts)

  1. RRikesh
    Posted 3 years ago #

    I don't know if I'm doing something wrong. When I am calling wp_set_post_terms with a term containing an ampersand, a new term with that name is being created.

    wp_set_post_terms( $post_id, $taxo[$term]->name , $taxonomy, $append );

    where $taxo[$term]->name = 'lorem & ipsum'

    However, when I rename the term to 'lorem and ipsum' I don't have any issues.

  2. s_ha_dum
    Posted 3 years ago #

    I bet you have an encoding problem. Something like this.... when lorem & ipsum is inserted, it is converted to lorem & ipsum, which doesn't match lorem & ipsum when you try to use the term resulting in the creation of a new term. That is speculation and exactly when and the where the encoding occurs may be wrong, but I think something like that is happening. It might be worth searching the Trac.

  3. RRikesh
    Posted 3 years ago #

    Thanks for the help. I couldn't get it to work though. Used 'and' instead of the ampersand to get away with this problem meanwhile.

Topic Closed

This topic has been closed to new replies.

About this Topic