WordPress Pages in an Array

Your changes $r[$page->post_name]; to $r[] = $page->post_name; are working fine when I checked them

Instead of return $r; use print_r($r)

You should see the list of all your pages. Also could you describe why you are using return $r

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