I use a WordPress theme for a blog but some other features were asked to add such as adding post programmatically to blog. After coding it works fine but I faced a problem with wp_insert_post
while using special characters. When it tries to insert a post which includes special character it gives an error. However, the theme which is on Wordpress can do it. What am I missing?
By the way it works in local even with special character
$var='ıışşüüççç'
$new_post = array(
'post_title' => $var,
'post_content' => $leadContent,
'post_status' => $postStatus,
'post_author' => $userID,
'post_type' => $postType,
'post_category' => array($categoryID),
);
$post_id = wp_insert_post($new_post);
Thanks in advance