Permalinks are not being set while using wp_insert_post
-
Hi there,
My permastructure is : %brand%/%product%
brand taxonomy is custom for the product.
I am adding post by wp_insert_post.
$post_id = wp_insert_post( $args );After insert, I run following.
$value = “Rolex”;
wp_set_object_terms( $post_id, array($value), $slug, true );Then file attached.
But my permalink is not including Rolex in the product link.
When I regenerate, it fix the brands.Is there any hook or code that need to be added after this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Permalinks are not being set while using wp_insert_post’ is closed to new replies.