Yes, my general problem was that i thought, that $link was some local wordpress variable for links because the post, on which i did test was only from links, i understood my fail too late, but when realized the problem, the solution was in one minute )))