Adding some condtions to save_post method.