when i choose category from dropdown then evrythng working fine.But in backend it checked only child not parent

Here my Code <?php if(isset($_POST[‘new_post’]) == ‘1’) { $post_title = $_POST[‘post_title’]; $post_category = $_POST[‘cat’]; $post_content = $_POST[‘post_content’]; $parent = get_the_tags($post_category);;…

When I choose category from dropdown then everything working fine.But in backend it checked only child not parent

Here my Code <?php if(isset($_POST[‘new_post’]) == ‘1’) { $post_title = $_POST[‘post_title’]; $post_category = $_POST[‘cat’]; $post_content = $_POST[‘post_content’]; $parent = get_the_tags($post_category);;…