How to hook into publish_posttype?

function looks fine, $single = true might be causing your problem, replace it with true

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)